Beyond all the local political intrigue and infighting surrounding Amazon pulling out of a planned new headquarters in Queens, sources told Page Six that there is watercooler talk among staffers at the Seattle tech giant that the deal fizzling had a hidden upside for Amazon leader Jeff Bezos.

“Bezos does not want to be under media scrutiny,” said a source. “New York is America’s media capital. Since the [Lauren] Sanchez story broke, he realizes what it would be like to be in the city a couple of days a week.”

Just a month before the Amazon pullout, ­Bezos’ bombshell relationship with Sanchez was revealed by the National Enquirer, and the Amazon boss announced publicly that his marriage to his wife of 25 years was over.

Sanchez has been spotted in New York once since then.

Page Six reported in late January that she was at Sette Mezzo, where she allegedly “walked in and waited for everyone to acknowledge her, like an actress.”

Perhaps Bezos would not want that kind of spotlight that New York offers.

But another source inside Amazon strongly insisted of backing out of the so-called HQ2 deal: “The decision had nothing to do with ­Bezos’ personal situation. Amazon has been scrutinized by the media its entire business life. The entire leadership was involved in making the decision” to scrap the Queens headquarters. The source said it was a “stretch” to link the plan being scuttled to ­Bezos’ current personal life.

Amazon announced on Thursday it was canceling its New York plan, saying that “a number of state and local politicians have made it clear that they oppose our presence and will not work with us to build the type of relationships that are required to go forward with the project.”

Last week, Bezos accused the Enquirer of attempted “extortion and blackmail” when he leaked e-mails from the tabloid’s editors that apparently threatened to publish embarrassing pics of him and Sanchez if he didn’t shut down an investigation into who leaked evidence of the relationship to the mag.