Losing on 1 health

imagine this you are battling a legendary and you have 16 hp but then their attack does 15 damage and then you see the losing screen i dont know if this is rare but it has happened to me and one of my friends

I dont know why this happen. last time this happen to me i survived

I died

hmm