Those blocks actually are compliant. They only do not look like all the ones after because of the script encoding rules for the numbers 1 through 16.
BIP 34 specifies that the height is encoded as "minimally encoded serialized CScript". For 1 through 16, this minimal encoding is actually the opcodes OP_1 through OP_16, which correspond to the hex values 0x51 through 0x60. All other numbers are length prefixed and encoded in little endian.
Is there a unit test in the codebase for BIP34 block checks, or validating new blocks in general?