I think it can happen in fights where the NPCs have some kind of weird "death" mechanic.

Like the guys in the Mermaid basement are somehow connected to the mask (if you knock them out and remove the mask they still die "because of the spell". So my guess is that this weird death interaction somehow bugged its HP. Maybe my Mirmidon AoE heal actually healed the corpse? Idk).

The watchers on the other hand have the self- explosion thing. Thats what probably leads to these unintended "undead" corpses.

This being said i'll always double check corpses HP from now on..