[I'm not full into techs so I might be wrong.]
The transaction failed or showed bad P2PKH because of the incorrect program size.
If the version byte is 0, but the witness program is neither 20 nor 32 bytes, the script must fail.
So from what I understand, your transaction bytes must be 21 bytes or so for the tx to be considered a P2PKH, hence if it's 20 bytes (as yours) it's considered a P2WPKH whereas you transaction was sent to a P2KPH.
There is no program size for P2PKH, BIPs 14x(0-3) do not apply for legacy P2PKH addresses.
If the script is 0x76 0xa9 0x14 <20 random bytes> 0x87 0xac then it is a P2PKH script.
If it is just 0x0 0x14 <20 random bytes> then it is P2WPKH
If it is 0xac 0x14 <20 random bytes> 0x88 then it is P2SH script.
Because the puzzle transactions are all P2PKH scripts then this is how you should spent them.