The ally ended up being the titular robot from the planet X - they may have destroyed the earth, but this one seems somewhat trustworthy.
This is the low-spoiler guide for "Getting back to the ship" puzzle in Dexter Stardust: Adventures in Outer Space. Unlike in normal walkthrough, you get gradual hints on how to solve the puzzle. Click the big button below to see your first hint. If the hint contains a spoiler, you will be warned about it before clicking.