BACK then everyone who was anyone ended up on the King’s Road. Pop stars, film stars, the money men, they all gravitated to London’s West End. Ted Heath was in Number 10 and Marc Bolan’s T Rex were Number One with Metal Guru, and on any given night on the King’s Road you might find Michael Caine or Roger Moore or Mick Jagger dining in Alvaro, the Italian restaurant run by Alvaro Maccioni and family.

The King’s Road drew the stars to it. Film director Peter Medak was one of them. In May 1972, Medak had just returned to London from a sour experience in Hollywood where he had walked off the film Death Wish. Wandering down the King’s Road, he was spotted by an old friend. It was none other than Peter Sellers, aka Inspector Clouseau, aka Doctor Strangelove, aka Bluebottle. Former Goon, film star, friend of royalty and for many, the greatest comic actor of his generation.

At the time Medak had a bit of heat to his name too. He had moved in the 1960s to Britain, where he directed A Day In The Death of Joe Egg and The Ruling Class, starring Peter O’Toole. The latter film earned Medak an Oscar nomination.

Death Wish was to be his big Hollywood break. But he wanted to make the film with Henry Fonda playing the part that would eventually be played by Charles Bronson. And at the 11th hour the studio United Artists changed its mind and said – you can have anyone but Fonda.

“I was so furious I walked off the movie and went back to England,” Medak recalls. “About a day later I bumped into Peter on the King’s Road and he asked me to do a film. And having just walked out of one really very big film, there was Peter with his arms open saying, ‘Come on baby, I know what happened.’ And that’s how the whole thing began.”

What followed, he says, would turn out to be “one of the most difficult experiences in 60 years of directing”.

These days Peter Medak lives in Los Angeles. He is 81 years of age but looks and sounds younger. Born and raised in Budapest, he fled to England at the age of 18. He got out after the 1956 Hungarian uprising against the communist regime, which would be brutally oppressed by Soviet forces. Even now, though, his accent still has the perfume of his birth country.

His IMDb listing suggests he has 68 credits to his name. They include The Changeling, Romeo Is Bleeding and the 1990 film, The Krays, starring Gary and Martin Kemp, as well as countless episodes of TV series, ranging from Magnum PI and Remington Steele to Hannibal and Breaking Bad. But talk to him for any length of time and there’s a sense that his career was never all that it might have been.

And the reason for that was the film he made with Sellars in 1973. Ghost In The Noonday Sun was meant to be a comic pirate movie. The shoot was a disaster, the film was never released, and the shadow of that failure seems to have stained Medak’s career ever since.

Read More: Jonah Hill on his directorial debut

Read More: Joe Cornish on The Kid Who Would Be King

Now he has made a documentary, The Ghost Of Peter Sellers, about the experience, and it's showing at the Glasgow Film Festival. The film is equal parts high farce and grumbling despair, one that centres around the sometimes debilitating nature of star power and the mercurial personality of the eponymous star in question.

Medak was first introduced to Sellers in the late 1960s. “I met Peter through Michael Caine and we used to regularly meet up for dinner in Kensington High Street,” he recalls as he sits in his LA home. “It was always Peter, Spike Milligan, Bryan Forbes, who was a wonderful English director, Roger Moore and Michael.

“Peter was a huge star. But stardom in England – bless England – wasn’t that enormous, insane thing it is in America. The whole celebrity thing didn’t exist in England that much. People were left alone. They could walk on the King’s Road or anywhere without being absolutely mobbed.

“When you met Peter and got to know him, he was amazingly funny. Not so much in his private life because he was manically depressive. But he had an incredibly magical persona and an incredible sense of humour. He was very warm and gracious and insisted on paying for everything. You could never pick up a tab for dinner and he was always giving away presents.

“But then, later on, one realised that one of the reasons he was doing it was because he was a great collector of anything new, anything mechanical and the only way he could keep them was to give away some of his older stuff.”

Did he ever give you presents, Peter? “Lots of them. At the start of the movie he gave me this incredible Omega underwater watch. But then at the same time when I was in New York he called me up and said, ‘You’ve got to bring me the new answer machine that’s came out. Bring me back six of those.’

“I brought them back and he met me at the airport. He couldn’t wait to get his hands on them. Later on, when I went around to his apartment to work on the script for Ghost In The Noonday Sun, I’m sitting in the living room downstairs and the phone kept ringing and he had organised the six of them in a rotating system and on each machine, he put a different Goon voice to take a message.

“He was a mad genius, brilliant, absolutely formidable comedian, actor, chameleon, everything.”

But that was only one side of Peter Sellers. Medak would soon learn that there was another.

In truth, Ghost In The Noonday Sun was a difficult project. From the get go the script didn’t quite work and Medak wasn’t entirely convinced that the comedian had ever actually read it.

Medak worked with another friend, Spike Milligan, to try to redeem it during pre-production. “But Spike was also divinely insane. He wanted to kill characters who had already been killed 10 pages before. So, I was trying to steer between the genius madness of these two people, Spike and Peter, and somehow have a script which has some kind of logic and tells a story. Did I ever succeed with it? I’m not sure at all.

“Sometimes you get into these things and think, ‘I just have to fix it along the way.’ And sometimes these things work out brilliantly and sometimes it’s impossible.”

Ghost In The Noonday Sun would turn out to be the latter. Maybe that should have been apparent on the first day on set in Cyprus. That was the day that the ship that the production company had bought and rigged out as a pirate set arrived in the harbour. And promptly sank.

In the weeks that followed, Medak learned that shooting onboard a ship “is completely insane”. But more importantly, he learned that while Sellers could be a wonderful friend, he could also be a nightmare to work with.

“I knew Peter was a lot of trouble,” Medak says in the documentary, “but that never worried me because I worked with the most difficult actors.”

“Everybody knew how difficult Peter was,” Medak reiterates during our conversation. “That was every director’s experience previously, however successful. Even Blake Edwards.”

Edwards had, of course, directed Sellers in A Shot In The Dark, the first Clouseau movie in 1964 as well as subsequent Clouseau outings.

Not so very long ago, Medak says, he and Edwards did a talk for the Director’s Guild of America. “Blake walked onto the stage and said, ‘Peter, everything you are going to talk about I have gone through the same thing with Peter Sellers.”

Sellers saw things differently. “I have a name of being very difficult,” he is heard saying in The Ghost Of Peter Sellers. “I am not difficult at all. I just cannot take mediocrity, I just cannot take it on any level.”

Medak wasn’t mediocre but there were no questions that the film they were making together in 1973 was problematic. There were days, Medak says, when Sellers could be “absolutely divine”. Others, not so much.

To start with Sellers arrived on set in a state of depression having just broken up with Liza Minnelli the day before he arrived in Cyprus. And it was soon clear that his enthusiasm for the film had also waned.

It announced itself in the first week when he had sacked the film’s producers. It normally happens the other way around.

Then, less than two weeks into the shoot, Sellers collapsed in the middle of shooting a scene. It appeared he’d had a heart attack. Sellers had a long history of heart problems. In 1964 he married Britt Ekland (after an 11-day courtship). On their honeymoon he had eight heart attacks and was, for a time, clinically dead.

So, when Sellers collapsed Medak feared the worst. “I was petrified when it happened. Because he had a terrible heart, as we all knew. We rushed him to the hospital, and we stopped shooting.”

A couple of days later, with the production closed down and the film’s future uncertain, Medak was sitting beside the harbour with the actor Peter Boyle. He picked up a copy of the Evening Standard from the day before and leafing through it he saw something he wasn’t expecting. “In the centre pages there was this photo of Peter having dinner with Princess Margaret at San Lorenzo in Beauchamp Place.

“I turned around to Peter Boyle and said, ‘Peter, look at this. This is insane. I can’t believe it. He is supposed to be in a hospital across the road.’

In a way it was proof of Sellers’s resourcefulness.

It should be remembered that Cyprus at the time was a divided island, with Greek Cypriots and Turkish Cypriots separated by a UN peacekeeping force. Somehow, Sellers chartered a plane and went back to London. “He had this date with Princess Margaret. And because of that he faked this heart attack,” says Medak. “He had to get out. It was more important to do that."

Sellers returned to Cyprus a couple of days after the Standard story ran. Medak inevitably confronted him. “I said to him, ‘Peter, how could you do this? It’s destroying the whole movie? How could you get out of hospital and go to London?’”

“Peter said to me, ‘Oh darling, please, I love you. But this hospital was terrible. So, I got myself out of there, flew back to London, got my doctor to check me out. There was nothing wrong, so I went out to dinner with Princess Margaret. Then I came back. By the way, here’s the doctor's certificate for the insurance company to prove it.’”

Sellers was the star and his idiosyncrasies had to be accommodated. The shoot staggered on. Filming on the ship was proving hugely difficult. The film’s extras rowed with the film crew and many of them walked off the set, taking their costumes with them.

Sellers and one of the film’s other stars, Tony Franciosa, fell out completely (the final straw came when Sellers’s driver spotted Franciosa start to bring his sword down on the comedian’s head before thinking better of it).

As a result, Sellers refused to shoot any more scenes with Franciosa; a little difficult as they still had a fight scene to film.

Things got worse. Sellers even suggested to Medak that the director should just quit, and he would give him half of the money he was due.

When that didn’t work Sellers declared himself shop steward of all of the actors and crew and asked for a vote of no confidence in the director. It was like a scene out of the 1959 movie I’m All Right Jack in which Sellers played the militant union leader Fred Kite.

It prompts a question about Sellers, I suggest to Medak. There are some who would argue that the comedian was a brilliant mimic, but maybe behind the mask there was nothing there. Is that how Medak saw him?

No, that’s not it, Medak says. “There was a very tragic, very lonely person behind that mask and that’s what he was hiding from, playing these other characters.”

Medak knew he couldn’t walk off the film because he would get all the blame so he carried miserably on. There were moments of ridiculousness still to come. At one point Sellers asked him if he would shoot an advert for Benson & Hedges cigarettes on a day off.

In the hope that it might improve relations Medak agreed only to be told that neither Sellers nor Spike Milligan, who was also in the ad, could be shot holding a box of cigarettes. The reason? At the time Sellers was chairman of the Anti-Smoking League and Milligan was the assistant chairman.

After all this Medak finally delivered Ghost In The Noonday Sun only to be told it wasn’t releasable. No wonder the experience was scarring. “I thought it was going to end my whole career because everybody always blames the director when something goes wrong.”

And he admits he shares more than a little of the blame. “I was trying to make a wonderful, crazy, funny film and I failed at it. I didn’t succeed with that film with that brilliant cast. You can’t stand in front of the cinema doors of the Odeon in Leicester Square saying, ‘I’m glad you’ve come to see the movie, but the film isn’t great because …’”

It’s hard to know how much it derailed Medak’s career. He kept making films because, as he says, “the only thing I know is how to make a movie”.

He made other films wherever and whenever he could and did his best to forget about Ghost In The Noonday Sun.

But now, some 46 years later, Medak has had the final word about the experience with this new documentary.

I wonder if after all this time Medak has forgiven himself for the failure of Ghost In The Noonday Sun? “No. Everybody keeps asking but I don’t think so. You can’t take away the past and that experience. It’s got its own resting place.”

But making the documentary has helped, he says. “The documentary is a wonderful addition to the film because it somehow really completes it.

“Sometimes I said to myself during the making of the documentary, ‘Is it possible that the only reason for making the original movie was I will be able to make this documentary?’”

The thing about making movies, Peter Medak says, is it’s like fighting a war. “It’s like going into battle and the main thing is to survive.”

Medak survived. Sellers? He died in 1980 at the age of 54. His heart finally gave in. In the end even legends are mortal.

The Ghost Of Peter Sellers is screening at the GFT on Tuesday, February 26 as part of the Glasgow Film Festival