In 1978, just as Monty Python’s Life of Brian was about to go into production, the chairman of EMI, Lord Delfont, got around to reading the screenplay his company had bought. He didn’t like it. He was so appalled, in fact, that he washed his hands of the whole outrageous venture, and the Pythons had to raise £2m in a hurry.

Eric Idle had the idea of phoning George Harrison, the richest person he knew; Harrison in turn consulted his American business manager, Denis O’Brien, who suggested that they fund the film themselves. The only snag was that they would have to remortgage Harrison’s mansion in Henley-on-Thames as well as O’Brien’s London offices. The ex-Beatle would go on to call it “the most expensive cinema ticket ever issued”. But, he reasoned, how else could he see the new Monty Python comedy?

So begins the story of HandMade Films, now the subject of a documentary called An Accidental Studio. It’s a story of friendship and falling-out, of stunning success and catastrophic failure, of an independent company that seemed to be making things up as it went along, but which could lay claim to several classics of British cinema – Life of Brian, The Long Good Friday, Time Bandits, Mona Lisa, Withnail and I. In Robert Sellers’ Very Naughty Boys: The Amazing True Story of HandMade Films, Idle puts it like this: “If you looked at the British film industry [in the 1980s] and took HandMade’s films out, there would be almost nothing left.” But, at the time, the company garnered hardly any Bafta nominations, let alone any Baftas. “They were ignored, really,” says Ben Timlett, co-director of An Accidental Studio. “The British film industry was much more interested in Merchant Ivory, whereas HandMade was down and dirty and different, and doing things the establishment couldn’t get its head around.”

Facebook Twitter Pinterest Classic … Paul McGann, Richard E Grant and Richard Griffiths in Withnail and I. Photograph: Ronald Grant Archive

The story of HandMade is really a love story: at heart, it’s about the love that Harrison had for Monty Python. When the first episode of Monty Python’s Flying Circus was aired in 1969, Harrison sent a fan letter via the BBC (they never received it, says Michael Palin), and he liked to say that the Beatles’ mischievous spirit migrated to the Pythons at around that time. Having brought Life of Brian back to life, though, he realised that he wanted to help other creative people, too – whether or not that made commercial sense. “If something’s really good,” he said, “it deserves to be made.”

What this meant was that HandMade repeatedly bet on first-time directors and unknown actors, and repeatedly salvaged films that other studios had thrown away. One of these was Mona Lisa, which, like Life of Brian, was dumped by EMI. Another was an earlier Bob Hoskins gangster film, The Long Good Friday, which was picked up by HandMade after it was dropped by Lew Grade – that is, Lord Delfont’s brother. The secret was Harrison’s own positivity, as his former right-hand man, Ray Cooper, confirmed at a question-and-answer session hosted by the actor Sanjeev Bhaskar last week. “If he believed you had passion,” said Cooper, “he would make your dream come true for you.”

Facebook Twitter Pinterest Gifted … Ray Cooper, creative director of HandMade Films – and Elton John’s ace percussionist. Photograph: Fairfax Media via Getty Images

Cooper’s appointment was typical of the company’s intuitive approach. He was, and is, a rock percussionist extraordinaire, as opposed to a movie-biz mover and shaker, but Harrison said: “I think I’ve got a film company on my hands. Why don’t you be me in the office?” This was a masterstroke. Cooper turned out to be a gifted script reader and problem solver, and while his new job appeared to be a far cry from pummelling kettle drums and cymbals on stage with Elton John, he felt that it was his musician’s ability to listen and to play along with others that was crucial to the company. His lack of experience in the film world was a plus. “The people at HandMade weren’t coming to it with lots of baggage,” says Bill Jones, co-director of An Accidental Studio, and the son of Monty Python’s Terry Jones. “They weren’t trying to follow trends, they weren’t looking at spreadsheets of figures. They just said, if you’ve got a great idea, we’ll back it.”

Facebook Twitter Pinterest Balance … US financier Denis O’Brien with George Harrison. Photograph: Press Association/PA

A significant part of Cooper’s job was to balance Harrison’s wishes with those of his partner, O’Brien. Harrison was content to keep the company as small and personal as its name implied, whereas O’Brien, in rock’n’roll terms, hoped to break America: he thought that he could build HandMade into a big international studio by bankrolling ever more costly films. What’s more, he was determined to oversee the artistic side of the company, as well as the financial side, thus alienating the Pythons and many other film-makers. “Denis became more and more convinced that his ideas were better than our ideas,” said Terry Gilliam last week.

Among those ideas were that Time Bandits should be a musical, and that Cathy Tyson’s role in Mona Lisa should be played by Grace Jones. He also complained to Bruce Robinson, the writer-director of Withnail and I, that he was behind schedule by lunchtime on the first day of shooting. In Richard E Grant’s film diaries, With Nails, the actor recalls the arrival of “the incredibly tall, incredibly bald Big Noise from HandMade Films who is a Bilko identikit on a giant scale”. Robinson raged that he would rather quit than put up with this outsized Bilko, and, as ever, it was left to Cooper to smooth things over.

“Denis was trying to make HandMade a self-sufficient company that didn’t need George’s money, says Timlett. “It’s not that that wasn’t the right thing to try, but that’s ultimately where it all went wrong.” The would-be blockbusters of the mid-1980s were the turning point. In 1985, there was Dick Clement and Ian LeFrenais’s Caribbean caper, Water, which, LeFrenais avers, is highly entertaining as long as you’re high while you’re watching it. The following year there was Shanghai Surprise, starring Madonna and Sean Penn, which went almost as smoothly as the rest of their marriage. Both films flopped. “I have the feeling that George never quite recovered from that,” Palin writes in his foreword to Very Naughty Boys. “He remained generous, but felt compromised and he began to draw back. Once that happened, the end was in sight.”

Facebook Twitter Pinterest Not Grace Jones … Bob Hoskins and Cathy Tyson in Mona Lisa. Photograph: Herbie Knott/Rex

After the early glory years, HandMade invested in too many films that barely saw the light of day, or the dark of the cinema. Cold Dog Soup with Randy Quaid, anyone? Checking Out with Jeff Daniels? Even the promising likes of Bob Hoskins’s directorial debut, The Raggedy Rawney, and Nicolas Roeg’s Track 29 were panned before vanishing without trace. With O’Brien in control, HandMade was losing money and Harrison was losing faith. Looking back at the company’s later projects, Harrison confessed to an interviewer that he frequently didn’t “like the script or the film” at all, but he didn’t want to rock the boat. In 1991, HandMade ceased to be. Its name and back catalogue were sold off three years later.

What An Accidental Studio doesn’t mention is that this hurtling rise and fall wasn’t just a case of too much expansion and too little quality control. Harrison sued O’Brien in 1995, and was awarded $11.6m in damages. The lyrics he had written for his Time Bandits theme song were weirdly prescient about HandMade’s ride: “Greedy feeling, wheeling dealing, losing what you won. See the dream come undone.”

Still, what a dream it was. In only a decade, HandMade was responsible for an astonishing number of genre-bending gems that wouldn’t be made today, and were lucky to get made back then. And, for a while, Harrison had the satisfaction of supporting his friends. The most touching part of An Accidental Studio is the footage of HandMade’s 10th anniversary party at Shepperton in 1989. It was more of a wake than a birthday bash: everyone knew that the company’s days were numbered. But the gallows humour of Harrison’s rueful speech was lightened when he professed his feelings for Monty Python – feelings that had got him into the film business in the first place. “I love them so much,” he says, “they’d be embarrassed if they ever realised.”

• An Accidental Studio is released in the UK on 29 April. It airs on AMC on 4 May.