Consistent part-
If a pokemon uses z-belly drum, and dies to recoil damage, the trainer of the pokemon that uses z belly drum glitches and /endbattle is needed. (recoil being double edge recoil damage, or rocky helmet/rough skin/iron barbs damage from a contact move)
Inconsistently-
When a pokemon with rough skin/iron barbs/rocky helmet faints as the same turn as the user, the battle is frozen, and /endbattle is needed.
Also works if user faints on the same turn as killing with recoil
After effects:
After /endbattle is used, the user's hp increases back up to what it was before rocky helmet happened.
Does not happen with-
Statuses (Burn, Poison, Badly Poisoned)
Weather Damage (Sandstorm/Hail)
Possibility of why its happening-
Innards out damage calculation may be funky with it, however innards out seems to work fine on its own.