Ben Affleck sitting beside Matt Damon in a scene from the film 'Good Will Hunting', 1997. (Photo by Miramax/Getty Images)

There was once a gay sex scene in the script of "Good Will Hunting."

Ben Affleck and Matt Damon were rookie screenwriters when they wrote the 1997 film about a gifted janitor working at Massachusetts Institute of Technology. They ultimately decided to go with Miramax Films, then run by Harvey Weinstein, to distribute the movie. Weinstein, whose company was known for independent and foreign flicks, beat out the competition for one reason: he actually read the script, and noticed the scene seemed out of place.

"Every studio wanted the movie, every studio wanted them to be in the movie and make this film," Weinstein said on "The Graham Norton" show earlier this month. "They were young kids, just really starting out, but they had some good roles behind them. They came to my office, and I read the script [before] the meeting, and we walked in and everything was pleasant, and then about 10 minutes into the meeting I said, 'Guys, there's just one thing on the script ... I just have one really big note. About page 60, the two professors give each other oral sex and they're on their knees and this whole big sex scene. What the hell is that? Because the guys are straight, and there's no hint of anything like that ... I don't get that scene.'"

Apparently, the inclusion was a purposeful one.

"They go, 'That's the scene that we wrote to find out whether guys in your job actually read the script, because every studio executive we went to ... no one brought that scene up, or maybe people thought it was a mistake or maybe nobody read it themselves.' They said, 'You're the only guy that brought it up. You get the movie.'"

Affleck and Damon had originally sold the rights to Castle Rock, but they began suspecting no one at the company was actually reading the rewrites the two were instructed to hand in. Or at least not reading them very closely.

"We were so frustrated that Castle Rock wasn’t reading the script, so we felt like we had to develop this test," Affleck told Boston Magazine in 2013. "We started writing in screen direction like, 'Sean talks to Will and unloads his conscience.' And then: 'Will takes a moment and then gives Sean a soulful look and leans in and starts blowing him' ... We would turn that in, and they wouldn’t ever mention all those scenes where Sean and Will were jerking each other off."