Hello! when you swap a pokemon while it's asleep or paralyzed, it get's stuck in a swapping state along with the one it's about to enter. The one it's not in combat counts as dead towards the end of the fight. It happened many times fighting the butterfly.
Interesting game overall. Thanks