I think instawin scenarios detract from the game, especially if it is a scenario that is repeatable, such as the Polymorph-Sphere scenario. That being said, rewarding creativity is a necessity and should should done when possible. If players do something like this, make it count, but don't make it end everything immediately.
Scenario 1: First purple worm expands and is regurgitated by the second. Both worms spend their next turn reguritating/being regurgitated. First worm takes 6d6 acid damage. Second worm takes 4d8 piercing damage.
Scenario 2: Polymorphed worm goes into the sphere, no save. Worm expands in the sphere. Sits there looking smooshed until the spell ends, where it finishes expanding. Takes 2d6 pychic damage from the emotional trauma each turn it stays in the sphere.
Scenario 1: First purple worm expands and is regurgitated by the second. Both worms spend their next turn reguritating/being regurgitated. First worm takes 6d6 acid damage. Second worm takes 4d8 piercing damage.
Scenario 2: Polymorphed worm goes into the sphere, no save. Worm expands in the sphere. Sits there looking smooshed until the spell ends, where it finishes expanding. Takes 2d6 pychic damage from the emotional trauma each turn it stays in the sphere.