punishing that does not make sense in the context of the game world is an immersion breaker and bad design.
if you shoot a goodguy, cops chasing you make sense. you health going down does not. that's a "bad designer! no twinkie!" if i ever saw one.
you should try to make something not possible due to circumstances that seem wholely reasonable and logical in the context of the game world. so you don't break immersion.
so what you want is an EMP gun, which does nothing to humans, except perhaps with repeated exposure at max power for decades on end. (the whole EM fields and cancer thing - IE don't build your house under high voltage power lines).
I don't want to complain or anything but I do know that there are games that do make you lose health if you do something wrong like shooting the wrong people.
Punishment is something game designers tend to lighten up these days. These days, game punishment is just minimum and isn't what it used to be. Only few of them stand out like Fire Emblem and Dark Souls but their audience is niche so that counts.
Now many platform games don't use the life system which I badly want it back because to them, its pointless.