The team finds an artifact or a room or something and Rodney activates it or is exposed to it or something and it makes him freak out. When they get back to Atlantis he kinda shuts himself off from other people. Turns out the Thing showed Rodney ways that things could have gone, an alternate timeline or something. And in that alternate timeline Rodney wasn't there, and things went way better. Rodney of course took this Very Badly.
John, of courses, is like "well thats bullshit," and goes back to the planet and interacts with The Thing and afterwards comes back and comforts Rodney and says that it was totally full of crap - turns out it basically tapped into people's insecurities or something, tokd everyone that things would be better without them.
If anybody could help me find it I'd really appreciate it!! Thanks!