I made an armor that takes 10 health then I died with the armor in my hand (gamerule keepInventory was true) and respawned with it in my hand too, and my health was 20!
I don't know if it's a feature or a bug.
Also, if I wear the armor my maximum health doesn't change, only if I hold it the max health changes.
Linked issues
is duplicated by 3
Comments

Relates to MC-16345. I really hope this gets fixed eventually, it is a huge problem when using attributes.
It's because you respawn before getting that item to increase your health. Consider it working as intended for the current time being until we have more control over how attribute modifiers are applied.