That’s true for most crimes. If you sneak into Bob’s bedroom and notice that he is already dead, but shoot his dead body anyway, you’ve technically only committed corpse desecration. (Setting aside the question of why you were sneaking into his bedroom with a loaded gun in the first place.) Intentionality is a central aspect of most crimes—that’s what distinguishes premeditated murder from manslaughter or felony murder.