The Office almost finished with a very different ending for Jim and Pam. As explained in Andy Green's new book, The Office: The Untold Story of the Greatest Sitcom of the 2000s, a lot of people behind the scenes wanted to end the show with the couple breaking up in the final season.
John Krasinski (Jim) was actually a big fan of the darker ending: “My whole pitch to Greg was that we’ve done so much with Jim and Pam, and now, after marriage and kids, there was a bit of a lull there, I think, for them about what they wanted to do… For me it was, ‘Can you have this perfect relationship go through a split and keep it the same?’ which of course you can’t. And I said to Greg, ‘It would be really interesting to see how that split will affect two people that you know so well.’”
Writer Brent Forrester confirmed what Krasinki says, adding, “Greg really wanted to do something extremely risky and high-stakes, which was the documentary airs and we see what effect it has had on these characters. And there was going to be a reunion episode where you see that Jim and Pam have split up by this time, and they will have their reunion in the reunion episode.”
After a scene where Brian saves Pam from an assault, beginning a possible bad ending for Jim and Pam, audience reaction was so negative, the show had to make drastic edits and change directions.
“People just absolutely did not like that,” Writer Owen Ellickson said. “They were bothered that there might be some triangle that Pam and Jim would be involved in and even more insulted that we thought they might believe that. That’s how it felt to me. Greg absolutely turned on a dime after that and we pivoted away, I think pretty skillfully given how quickly we had to do that.”
[Via]