A “lost” James Bond movie written by Peter Morgan, the Oscar-nominated screenwriter of Frost/Nixon and The Queen, would have seen Daniel Craig’s 007 forced to kill Judi Dench’s spymaster M in a shock finale, according to a new book.

Morgan’s screenplay for the proposed film, titled Once Upon a Spy, was turned down by Bond producers and director Sam Mendes prior to the release of 2012’s Skyfall. However, the script’s key elements, which included a mistake from M’s past coming back to haunt her and the MI6 bigwig dying at the end, were retained for the $1.1bn blockbuster.

Interviewed for the book Some Kind of Hero: The Remarkable Story of the James Bond Films by Matthew Field and Ajay Chowdhury, regular Bond screenwriter Robert Wade suggested that Morgan’s mistake was to veer too close to the style of John le Carré, rather than 007 creator Ian Fleming.

Once Upon a Spy would have flashed back to M’s days as an MI6 agent stationed in Berlin during the cold war. Her affair with a KGB agent has lasting ramifications three decades later when the man’s son, a Russian oligarch, surfaces to blackmail the spymaster. Bond is called in to tackle the villain, but is forced to kill M at the movie’s denouement.

“[Co-writer] Neal [Purvis] and I are pretty well steeped in Fleming. I think Peter was more interested in Le Carré. It just didn’t work,” said Wade, according to Digital Spy. “We always found [the script] really, really difficult to make credible or satisfying. It was very dark … The only thing that remained was that M’s past comes back to haunt her and she dies at the end.”

Wade and Purvis rewrote Morgan’s screenplay into a script titled Nothing Is Forever, which was finally retitled Skyfall. The latter film went on to be the highest-grossing film so far in the long-running spy series, and received excellent reviews.