Shredder makes the turtles believe they have left cyberspace, when they are really still there giving him important information about how to build a portal.
When the Time Window is repaired, the Turtles enter it to go home, but instead of ending up back at the lair they are sent on a harrowing trip through the past, present and future.