The Return of Maggie Beckett - S5-E9
Other mistake: The group slides to Fresno, where there is a monument to Maggie Beckett and the astronauts that were lost on an Intrepid mission to Mars. On the memorial stone, her name is misspelled as Maggie Becket, not Beckett as everywhere else.
Chosen answer: Remember at first Quinn's timer is working perfectly (it's only because they slide off the ice age world early that it begins to malfunction) & given Quinn's intellect he would have devised a way that he could open a wormhole near him so he wouldn't be trapped on that world for 29 years.