The message spell doesn't provide feedback
A caster doesn't know automatically when he's cast a spell on an invalid target; instead, nothing happens and the spell just fails. (On Spell Failure says, "If you ever try to cast a spell in conditions where the characteristics of the spell cannot be made to conform, the casting fails and the spell is wasted.") And that failure could've come about due to a variety of circumstances.
The only feedback a caster typically receives from any spell is the feedback from a spell that has both a Target entry and has a Saving Throw entry other than none. In that case, the caster learns only if the target succeeds on the saving throw against the spell. Other information must be gleaned from observation, special abilities, and as the result of the spell itself coming into effect. (See also Magic on Saving Throws.) (Note that the message spell has a Saving Throw entry of none; further, were the spell to have, for example, the entry Saving Throw: Will negates, an invalid target just wouldn't make the saving throw—therefore neither succeeding nor failing—, and the caster would still receive no feedback.)
This means that the simple act of casting the spell message on the typical wholly inanimate and totally-not-a-creature corpse or statue does not somehow provide feedback to the caster that reveals the spell failed—the caster lacks a heads-up display that flashes Invalid Target, for instance. However, because a typical wholly inanimate and totally-not-a-creature corpse or statue can't and won't be replying using the effect of the message spell, the caster may still surmise that target's nature.