Fail to encrypt scriptPubKey in testnet
First of all, scriptPubKeys are not encrypted and what you are doing is not encryption. This is encoding.

The problem is that you are trying to encode a P2SH address as a P2PKH scriptPubKey. P2SH addresses are different from P2PKH addresses and have different opcodes. You can identify them by looking at the version number of the address which you are not doing. The version number actually has a meaning, it is not ignorable. Your scriptPubKey should actually be 

OP_HASH160 01b47e5722f808856a308fa043ccf28323f51711 OP_EQUAL