Any damage carried over will be affected by the new form's traits
This is because resistances, etc. apply whether the damage is dealt or applied in some other way.
If a creature or an object has resistance to a damage type, damage of that type is halved against it. If a creature or an object has vulnerability to a damage type, damage of that type is doubled against it.
To clarify, it specifies that damage is halved without any mention of how the creature receives it. I think you would be hard pressed to say that the carried over damage is not "against it." Also, the damage itself is changed, not just the HP lost, which leads to the entire set of damage being modified before carrying over to the other form.
Here are a few cases to consider (Altered Form has 10 HP, takes 40 damage):
- Altered Form has resistance, Original Form does not
- Altered Form modifies the damage to 20 causing 10 to carry over.
- Original Form has resistance, Altered Form does not
- Altered Form takes full damage causing 30 to carry over which is modified to 15.
- Original Form and Altered Form have resistance
- Altered Form modifies the damage to 20 causing 10 to carry over which is modified to 5.
The stacking of resistances in the 3rd case is due to the wording of the feature. While normally multiple instances of resistance against the same damage type do not stack, the creature only has one instance of resistance at a given time. A plain reading of the polymorph spell gives us that the damage is "carried over" which means "transferred or resulting from a previous situation or context." An answer on a similar feature has clarified that transferred damage is affected by type-based damage modifications. If we take the second portion of the definition of carry over, the word "resulting" give us an entirely new instance of damage as a "result" is a separate consequence than the cause in plain reading.
Sage Advice
This answer is further reinfoced by the official rules clarification document Sage Advice Compendium as of October 2020:
If a creature under the effects of polymorph takesenough fire damage to revert to its true form and that form has fire resistance, does the true form take the full remaining damage or only half due to resistance? When the creature reverts to its true form, any leftover damage is subject to that form’s damage resistances, if any.