Screenshot below, but for context: I've been farming Misdreavus. The last thing that happened was me throwing a pokeball at a sleeped 1hp Misdreavus followed by me... catching it but it dying, me dying, and me "winning the battle" without being able to choose any other pokemon....?? The screenshot will probably explain better than this half asleep boye will.
Tldr catching misdreavus lead to it 1shotting me from full hp, being caught, both fainting and me winning the encounter