The command I've used isΒ /attribute @p minecraft:generic.max_health base set <value>
This command does update the max_health attribute but it does not update the player's health such that it matches the specified max. In other words, I'm able to have a health of 20 while having a max health of 5. Damage is required to update your health value to the correct value. All regeneration heals up to the max_health value.
Linked issues
duplicates 1
Comments 2

Thank you for your report!
We're tracking this issue in MC-180001, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki
-- I am a bot. This action was performed automatically! Please report any issues in Discord or Reddit
That's because it's MAX health, not Health, they are two different things, Max Health is an attribute, Health is an NBT tag.