When leaving and rejoining the world with a health boost effect, the extra health containers still remain, however the extra health is removed as you are reset back to the default amount of ten hearts.
Steps to Reproduce:
1. Obtain a health boost effect
2. fill any of the extra hearts while the effect is still active (some or all, either works)
3. Leave the world and rejoin
The world should have saved the amount of extra hearts you had filled up.
The world does not save the extra hearts, leaving you with the default ten.