Sadly, I could not record qhat happened, but it's easy to explain.
Enemy had 3 layers of spikes up.
Enemy has low hp rotom in
I have high hp ferrothorm in
Rotom uses pain split
I switch to my kingdra who's hp was low enough to die to spikes
What should have happened: kingdra should have died, and pain split should have failed.
What happened: kingdra did NOT take spikes damage, and pain split worked.
This issue could be exploited with good prediction, so please fix it as soon as possible. Thanks for your time. ^.^
UPDATE
The bug seems to be present whenever there is an hp change when switching in.
This time, I surfed a water absorb lapras that should have died to stealth rock, however, as it didn't, because of the same reason, an hp change, this time caused by water absorb.