How does Max-HP reduction affect wild-shaped/polymorphed creatures?

Certain creatures have abilities which can reduce a character’s maximum HP, and usually if it gets reduced to 0 the character dies outright.

Suppose a HP30 PC is wild-shaped/polymorphed to a creature with 50HP, they get into a fight with a Wraith and take a few hits dealing a total of 30HP. If they failed the con saves, that PC’s max-HP is reduced by 30, but it’s still at 20.

An interesting, perilous situation.

Do they die instantly? Would feel a bit unfair since they’re standing there with a bunch of HP. Is the damage just shrugged off like normal damage upon return? The Druid’s wild-shape section is quiet on status conditions, though it’s pretty blatant about HP:

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.

That sounds like a free pass, but it would reduce the danger of these fights considerably. I’ve been assuming the PC becomes a sort of ‘dead man walking’ where if they revert the HP reduction will carry and they’ll die instantly. But I’m not sure.

If that’s the case, they’ve got a ‘Crank’ like situation where the PC has less than an hour (before the wild-shape/polymorph wears off) to find a Heal or Remove Curse.