It's possible to have higher maximum health than actual health (see MC-16345) because the helth doesn't adequately update server-side when an attribute stops being applied.
In this state, when the player takes more damage than its max health, the client will show the death screen. However, since the maximum health has not actually been updated yet on the server side, the player doesn't die server-side. When the player then clicks "Respawn", the game continues as if the player hadn't died.
This is a client-server desync where on the client-side, the player dies, but server-side, it doesn't.
To reproduce
Place a wither rose
Switch into survival mode
Give yourself this item:
/give @p dirt{AttributeModifiers:[{AttributeName:"generic.max_health",Name:"generic.max_health",Amount:20d,Operation:0,UUID:[I;0,1,2,3],Slot:"mainhand"}]}
Select the dirt block
Run this command to fill your health:
/effect give @p minecraft:instant_health 1 3
Deselect the dirt block
Walk into the wither rose
→ ❌ You die immediately (because the server sends to the client "decrease health by 20 because max health changed")
→ ❌ On the death screen, you continue to take damageClick "Respawn"
→ ❌ You don't respawn, but are still at the same location as if nothing happened
These actions can also cause this bug from being triggered, apart from being damaged by a wither rose:
Instant health effect
Instant damage effect
Poison effect
Suffocation
Drowning
Starvation (Hunger)
Hitting a wall with elytra
Linked issues
relates to 1
Attachments
Comments 49
It's still happening in Minecraft 1.6.2. Check MC-29319 for simpler repro steps.

Confirmed for
14w30c
14w31a
Minecraft 1.8-pre 1
Form MC-33827:
Give yourself an item with the max health attribute
/give @p dirt 1 0 {AttributeModifiers:[0:{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:10000,Operation:0,UUIDLeast:894654,UUIDMost:2872},1:{AttributeName:"generic.movementSpeed",Name:"generic.movementSpeed",Amount:2.5,Operation:1,UUIDLeast:111113,UUIDMost:1111},2:{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:40,Operation:0,UUIDLeast:111113,UUIDMost:1111}],display:{Name:"GodSword 2.1",Lore:["The Ultimate Power","By Vengeur69"]}}
Give yourself constantly the instant health effect by a clock or just use this command:
/effect @p instant_health 300000 5
Get hurt (this doesn't always work on the first try, the best way is to use this command; seems not to be necessary)
/effect @p instant_damage 300000 1
And now select and deselect the item with the max healt attribute very often
I know some of the steps here use other bugs, but this also works without using these bugs
I am able to reproduce this, while healing with Regeneration, as I took damage, it showed I died, but my health is still full. And my health is still Regenerating. Once I hit the respawn button, I went all sideways (half dying animation). I'm playing on 1.8.1
The more you do it, the lower the player gets
Can confirm in 21w07a. Video attached.

Can confirm in 21w11a
but if modifying health with the /attribute command you have to specify your name (@s doesnt work)
Can confirm in 21w17a.
I see this is "In Progress". Perhaps fix it and make it also a feature somehow?
Fixed!
Seems like a combination of MC-18027 and the issue where getting healed at the same time as you die causes you to turn sideways (which I can't seem to find).