Can a gargantuan creature be shoved into a demiplane using polymorph and released into a different plane of existence


For context, my party is going to face a gargantuan (20 by 20 ft. or larger) creature with obscene levels of health, so would it be possible to make a demiplane and polymorph the gargantuan creature down to size and then shove it into the demiplane, trapping it there.

This spell transforms a creature that you can see within range into a new form. An unwilling creature must make a Wisdom saving throw to avoid the effect. The spell has no effect on a shapechanger or a creature with 0 hit points. The transformation lasts for the duration, or until the target drops to 0 hit points or dies. The new form can be any beast whose challenge rating is equal to or less than the target’s (or the target’s level, if it doesn’t have a challenge rating).

After trapping it there, would it be possible to release it in, let’s say, Hell or just a ‘void’? This is saying that the creature has utilised everything it can to resist magic and it is shoved into the demiplane.

This is saying that the creature has utilised everything it can to resist magic and it is shoved into the demiplane.