The Bug
I gave me an Item with the Attribute genericMaxHealth (more than +20 health) and then I got some little damage. I dont die but I saw the death screen and my skin was diagonally and red, like I would actually dying.
Steps to Reproduce
create a world in creative mode, cheating allowed
get arrow and bow
do the command
/give @p minecraft:dirt{AttributeModifiers:[ {AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:40,Operation:0,UUIDLeast:55792,UUIDMost:935474,Slot:"mainhand"}]}
go in Survival mode
hold the dirt in your mainhand
wait until you are fully healed (all 30 hearts)
shoot slightly with the bow in the air and let get punched by the arrow
I have tested the bug with some other damage: crossbow, trident, hitting from a spider. Sometimes it didnt work.
I know this is a duplicate, or at least a related report, but I don't have the ticket number at the moment.