You're script should work.
Only reason I can think would be another mod that uses the same hook being done badly.
You mentioned in another post Gcombat. I've seen posts of Gcombat breaking certain functions of ULX, and atomicspark mentioned it being a mess.
Gcombat may not be the issue, but, search your other mods for the text "CanPlayerSuicide"
I'm betting one of them is returning something when it shouldn't be.
The function I was talking about in lib.lua are checkDeath and checkSuicide.
We use them both for during punishments where we don't want the person to kill themselves.
Jail, Maul, just to name a few.