If its type is humanoid in its humanoid form and something else in its true form, then its statistics are not the same in each form.
Actually... I think you are right here. Form =/= type. And type is a statistic. Thank you. Vote changed
That said, it is worth noting that this isn't really a wasted spell as the caster, and possibly the whole party, now knows a little bit more about their foe when the DM rules Hold Person an auto-failure in this instance. They can infer that they are either dealing with a creature that is immune to spells or that they are dealing with a non-humanoid shapeshifter. The spell did a job, just not its primary one.