Can you defeat a Gargantuan monster from the inside? [duplicate]

This question already has an answer here:

  • Can you kill a gargantuan monster from within? 1 answer

This was something me and my friends were wondering about for a while, and we’re not sure if it would work or not. Disclaimer; all of us are novices and only just started playing about half-a-year ago.

We were coming up with unique ways to defeat a monster that is Huge or Gargantuan in size. I’ll just use the Tarrasque as an example since that was our target in the conversation. The idea is for a player to get eaten by the Tarrasque and then while inside use a spell like Shapechange or True Polymorph to transform into another Huge/Gargantuan creature to rupture its internal organs. The specific creature I chose was the Purple Worm, a CR 14 monster that can burrow. I believe there were some spells that won’t allow you to transform if you don’t fit, but I don’t remember seeing that in the Shapechange spell wording. Is this possible or would the size of the monster’s stomach stop this from working?