Rami Malek as Freddie Mercury in Bohemian Rhapsody. Photo: 20th Century Fox

Over the course of its two-hour and 15-minute run time, the sprawling rock-and-roll bio-drama Bohemian Rhapsody does a thorough job of sanitizing the life of one of rock’s most debauched superstars: Queen’s virtuosic, libidinous, coke-snorting, champagne-guzzling frontman Freddie Mercury. The PG-13–rated film — which arrives in theaters Friday, featuring Mr. Robot star Rami Malek in the lead role — charts Mercury’s ascent from lowly baggage handler at London’s Heathrow airport to the pinnacle of pop stardom, performing before a televised audience of some two billion people during 1985’s Live Aid charity concert.

En route to that crowning achievement, viewers are introduced to the bucktoothed, Zanzibar-born Farrokh Bulsara and his sometimes-contentious relationship with his conservative Indian Parsi family. We see Freddie’s marriage to his college-age sweetheart (played by Lucy Boynton) — despite his obvious attraction to men — and more than a few Behind the Music–esque recreations of recording sessions for the band’s most famous songs. It’s an ensemble effort, with Gwilym Lee, Ben Hardy, and Joseph Mazzello portraying Queen bandmates Brian May, Roger Taylor, and John Deacon, respectively. But critical consensus has so far slagged Rhapsody as a by-the-numbers biopic short on artistic risks — a relatively chaste showcase when it comes to depictions of gay love, watered-down recreations of Mercury’s riotously orgiastic parties; scant exploration of the loneliness and existential despair that compelled the singer’s more extreme behavior; and only a brief montage centered around Freddie’s attendance of Rough Trade nightclubs.

Stephen Frears was just one of several directors hired to direct an earlier iteration of the Queen biopic — his version was simply titled Freddie Mercury, and set to star controversial comedy provocateur Sacha Baron Cohen — that would have been a far cry from this sugarcoated, mainstream-friendly version of Mercury’s legacy. “Sacha wanted to make a very outrageous film, which I would imagine Freddie Mercury would have approved of,” Frears tells Vulture. “Outrageous in terms of his homosexuality and outrageous in terms of endless naked scenes. Sacha loved all of that.”

Now, Bohemian Rhapsody arrives amid a crowded awards season, with no small amount of Oscar buzz for Malek’s uncanny impersonation of Mercury. However, having taken nearly a decade to reach the screen, the movie must overcome the meta-narrative around it, including numerous false starts, production shifts, and mudslinging dust-ups over the film’s casting, tone, and plot. A roundelay of prestigious directors came and went over the years, and the project hopped from studio to studio before things almost completely fell apart toward the end of principal photography last winter, thanks to the unexplained absenteeism of Rhapsody’s credited director Bryan Singer.

As producer Graham King tells it, “The reason this took so long to get made is, [Mercury] had a very complicated life,” he said at a post-screening Q&A session, on the lot of Bohemian Rhapsody’s distributor Fox Films, earlier this month. “And it’s just getting the balance of someone’s life story and the band’s life story into a two hour and 15-minute film. We just felt like, if we can get a theatrical film and cover most of the story and give the audience an entertaining way to look at his life, and how uplifting the end of his life was, and the balance of his sexuality, then I think we could have a hit movie.”

The needle first dropped on the Bohemian Rhapsody saga in 2010, when screenwriter Peter Morgan (Frost/Nixon, Tinker Tailor Soldier Spy, Netflix’s The Crown) called King to inform him he had begun work on a biographical drama about Queen, chronicling the lead-up to the group’s Live Aid performance before 72,000 people at London’s Wembley Arena. In turn, King — a prolific, Academy Award–winning producer behind such films as World War Z and The Departed — met with band members May and Taylor and convinced them to sell him their life rights.

What happened next is a matter of some internal dispute. That year, Cohen — a comedy superstar, but one with zero dramatic-acting experience at the time — was “announced” as having accepted the role of Mercury. But in a recent interview, King said the comedian was never technically cast beyond publicly announcing his interest in the role.

The film was set up at Sony the following year. A former studio executive there says that the project gained traction thanks to Cohen’s commitment. “I’m not sure whether Sacha was attached from the very beginning of Sony’s involvement, but there was definitely a period where [he] was meant to star and he and the studio met with directors,” the executive says. “It was a biopic of Freddie more than the story of the band, although a portion of the structure dealt with the ups and downs of the band, but always from Freddie’s POV.”

With the backing of Sony co-chairman Amy Pascal, Cohen courted respected directors, including The King’s Speech filmmaker Tom Hooper and David Fincher, before Frears was announced in the industry trades as the “frontrunner” to direct the biopic in 2012. But Frears quickly realized his star and the members of Queen were on a collision course due to their fundamental disagreement over the film’s plotting. May and Taylor approached the movie with a “certain amount of caution” in an effort to preserve Mercury’s legacy, while Cohen reportedly remained interested in a “gritty R-rated tell-all” about the singer (Mercury died from complications due to AIDS-related illness at age 45). “You could always tell there would be trouble with the rest of the band,” says Frears. “Because [Sacha] was so outrageous and they weren’t. They were much more conventional.”

But in 2013, the comedian unexpectedly departed the project, later confirming he had been interested in portraying Mercury’s “extreme lifestyle [of] debauchery.” (Frears says he “sort of drifted away” after Cohen left.) In 2016, on Howard Stern’s Sirius XM radio show, Cohen said it was a conversation with a member of Queen that sent him packing. “[After] my first meeting, I should never have carried on because a member of the band — I won’t say who — said, ‘This is such a great movie, because such an amazing thing happens in the middle of the movie.’ I go, ‘What happens in the middle of the movie?’” Cohen said. “He goes, ‘Freddie dies.’ I go, ‘So wait a minute. What happens in the second half of the movie?’ And he said, ‘Well, we see how the band carries on from strength to strength.’ And I said, ‘Listen, not one person is going to see a movie where the lead character dies from AIDS and then you carry on to see the band.’” (Cohen declined requests from Vulture to be interviewed for this story.)

In response to that interview, Queen guitarist May called Cohen “an arse” and said the band members had “decided he wasn’t right for the role.” (Taylor and May are credited as executive music producers on the movie and, crucially, control the licensing rights to Queen’s music.) According to the former Sony executive, however, during the time the project was at the Culver City studio, no draft of the screenplay was ever plotted with Mercury’s death occurring in the middle of the picture. “I suppose that may have come up among the creative team and the surviving members of the band,” the executive says, “but I never read a script structured that way.”

Dexter Fletcher (Eddie the Eagle) was brought in to replace Frears, casting British actor Ben Whishaw (Paddington, Spectre) in the lead role. But after clashing with King over his intention to film an R-rated drama, Fletcher abandoned ship, too. In 2015, around the time Sony’s Pascal stepped down from her position amid fallout from the studio’s North Korean hacking crisis, the project lost support at Sony and found itself suddenly orphaned.

Undaunted, King moved forward with casting: He met with Malek for five hours in L.A. before the film had secured any kind of distribution agreement, and was ultimately persuaded he’d found his Freddie after the actor sent him a video clip of himself performing in character. From there, Malek convinced the producer to spring for a dialect tutor and movement coach as well as a set of false teeth that proved key to his concocting of the character. (Fox declined to make Malek or King available to speak with Vulture.)

A year later, King brought the project to Fox, which at the time was making a push into “event” movie musicals with such projects as the Hugh Jackman song-and-dance vehicle The Greatest Showman. According to an industry source with a years-long overview of Bohemian Rhapsody’s development process, Fox maintains first-look deals with a number of director-producers who have delivered big hits for the studio. And given the complexity of adapting the material as well as the steep cost of acquiring the musical rights to Queen’s music (which had never been secured at Sony), King and Fox executives felt confident about handing the reins to Bryan Singer, whose X-Men movies have combined to gross over $2.7 billion worldwide.

Principal photography began in London in 2017, with the film’s shooting script credited to Anthony McCarten, the Academy Award–nominated screenwriter behind The Theory of Everything and Darkest Hour. (Morgan, the screenwriter when it was still at Sony, retains a “story by” credit.) The first sequence the production filmed was the movie’s climactic final scene: Queen’s Live Aid set, which is widely considered one of the greatest rock-and-roll performances in history. “It was a terrifying prospect to try to take on the most iconic concert of all time. But in that situation, you sink or swim,” Ben Hardy said during the Fox Q&A. “It forged us together as a band. It was such an important thing in this film to capture this rapport, the amazing rapport that the band had, this family feel. And I think taking on that challenge so early on really did force us together in that sense.”

But in December, Singer — whose career has been dogged by long-standing allegations of unprofessional behavior on-set, partying with underage boys, and sexual assault — was fired from Bohemian Rhapsody after repeatedly clashing with Malek during production (reportedly throwing electrical equipment during one fit of pique) and then failing to show up for work for long, unexplained stretches. Things got so bad that cinematographer Newton Thomas Sigel was reportedly required to step in to fulfill some of Singer’s duties. Fox justified the director’s dismissal with a piquantly worded statement about his “unexpected unavailability.”

For his part, Singer blamed his absenteeism on unspecified health care issues and the need to care for a “gravely ill parent.” “I wanted nothing more than to be able to finish this project and help honor the legacy of Freddie Mercury and Queen,” Singer said in a statement, “but Fox would not permit me to do so because I needed to temporarily put my health, and the health of my loved ones, first.”

That talking point was backed up by King. “Brian had a lot going on in his life,” the producer said at Fox. “He had a lot of family issues. His mother was very sick and he wanted to hiatus the film. And the studio didn’t see it that way, didn’t want a hiatus so close to the finish. He needed to leave the film.”

Closing the loop on so many years of production and development dysfunction, Fletcher — who recently wrapped production on Rocketman, a musical biopic about Elton John, set for release next year — was brought back in to complete Rhapsody later that month. “I came into the last few weeks of principal photography and editing and the bits and pieces like that,” the director told Indiewire in May. “So I was lucky to have a really good input to something, but it’s really about watching what had already been created and being a part of that. It wasn’t like changing and reinventing the wheel.”

So was it worth all that development hell and studio head-banging to bring Bohemian Rhapsody Galileo-ing to the screen? King has publicly admitted he can’t believe the film finally managed to come to fruition. And even though Rhapsody’s general excellence may be in question, Malek could have a strong shot at nabbing a Best Actor Oscar nomination. “Put Rami Malek high on the list for best film performances of 2018,” wrote Rolling Stone’s Peter Travers. “Watching Bohemian Rhapsody, we always feel like we’re seeing Freddie Mercury standing right in front of us,” Owen Gleiberman said in Variety.

Malek says his biggest challenge was finding the humanity in someone he considers a “deity” while doing right by the surviving members of Queen. “When I got this role, I thought, ‘Oh my God, this could be a career-defining performance.’ About two minutes later, I thought, ‘This could be a career killer!’” the actor said at Las Vegas’ CinemaCon where the first footage from Bohemian Rhapsody was publicly unveiled in April. “I’d like to think I gave a good performance. I leave it up to you to decide. But Brian May emailed me after seeing the movie and said how moved to tears he was. ‘If Freddie were here today, he could not be more proud of what you were able to achieve.’ That, I will take to my grave.”