The bug
When you lose the health boost effect, your health replenishes to 20 health points.
How to reproduce
Get the health boost effect (/effect @s health_boost 60 3)
Take damage until you have less than 20 HP
Drink milk or wait until the health boost effect runs out
Observed Result: When you have less than 20 HP and then you lose the health boost effect you are fully healed to 20 HP.
Expected Result: Your health should remain the same after the effect is lost.
Please confirm that you are playing the latest release version (currently 1.19.51) as shown on the initial Minecraft screen.