It sticks to the druid and applies in every form.
The other answer you cite argues thusly:
Damage taken in animal form doesn't affect your original form's HP unless you're dropped to 0 HP in animal form and there's excess damage. Nowhere is it suggested that max-HP reduction would work any differently...
This reasoning is wrong. The Wild Shape rule says that damageis this:
When you transform, you assume the beast's hit points and Hit Dice. When you revert to your normal form, you return to the number of hit points you had before you transformed. However, if you revert as a result of dropping to 0 hit points, any excess damage carries over to your normal form.
So, when you revert, you return to the animal form don't affectnumber of hit points you had before you transformed--any damage does not "carry over to your normal form" except in the original form's HPcase where the beast form dropped to zero. Max-HPBut the maximum hit point reduction is not damage. It's a separate effect from damage, and Wild Shape doesn't say that effects in general don't carry over between forms.
The target's hit point maximum is reduced by an amount equal to the damage taken. This reduction lasts until the target finishes a long rest.
Who or what is the target? The druid. Therefore the druid's maximum HP will be reduced until the druid finishes a long rest. This applies to every form. When the druid takes on a form, you look up the hit points it will have in that form, and then subtract whatever reduction it's suffering to its maximum HP.
So in this example where the bear loses 24 max HP, in step 3 the druid should be at their new maximum of 21.