It was the perfect subject for a documentary. Beloved American stand-up comedian and magician John Edward Szeles — aka The Amazing Johnathan —known for his pranks, charm and addiction to hard-core drugs, is diagnosed with cardiomyopathy and given one year to live.

First-time documentarian Ben Berman had always been interested in Johnathan’s work. The 37-year-old director told the Journal he wanted to do a story on Szeles and had originally intended to make a short film.

“The idea I had was more of a short film, fly-on-the-wall, almost a D.A. Pennebaker modern-day documentary: living with the guy, sitting in Vegas waiting for death with emotion and sincerity and with dark humor. I wasn’t super nervous. It was pretty low-stakes.”

But they say truth is stranger than fiction for a reason, and the filming of “The Amazing Johnathan Documentary” took a decidedly unique turn when Berman discovered a second camera crew was filming Johnathan, 60, for another documentary. That “second camera crew” turned out to be the producers behind two Academy Award-winning documentaries, “Searching for Sugar Man” (2012) and “Man on Wire” (2008).

“At first, I had no roadmap, it was exploratory time,” Berman, a Los Angeles resident, said. “Then Johnathan announces that he was going to map a comeback. … Then when the second camera crew came into his life, I ultimately was faced with a choice: Do I give up and not compete with this professional documentary crew when I’m just an amateur or do I continue to make this movie?”

Berman chose to move forward and insisted on incorporating everything, including telling Johnathan’s story while filming the other crew filming Johnathan’s story.

This rapid change also forced Berman to become a character in his own narrative.

“I didn’t set out to be in front of the camera. I’m a behind-the-scenes guy,” Berman said. “I never intended to go as deep into my past and my family and my potential motivations. I’m very happy with it, but it was a big, big struggle. I would like to think this movie is a very, very transparent documentary. It becomes so referential and self-reflective.”

Because the standard rules of storytelling were broken early on, Berman felt comfortable experimenting with various documentary tropes. He shows Johnathan in his Las Vegas home smoking meth and spending time with family and friends, and the director has star comedians Carrot Top and “Weird Al” Yankovic appear in interviews.

“I didn’t set out to be in front of the camera. I’m a behind-the-scenes guy,” -Ben Berman

Berman said at a time when there are “so many of me, dumb Ben Bermans who need a story to tell and there aren’t so many Johnathans,” creating new and original content is important. He cited last year’s Netflix and Hulu documentaries that exposed the fiasco behind the Fyre Festival as examples.

Berman also went one step further in his film, psychoanalyzing himself by featuring family home videos and allowing his friends and family to offer advice during the filming process. Home is Allentown, Pa., where Berman attended Hebrew school and became a bar mitzvah. He attributes his exploration of comedy in his film about Johnathan to his Jewish roots.

“I feel my sensibility regarding dark humor is entwined with my Jewish upbringing and the Jewish mentality of seeing humor in darkness and darkness in humor,” he said. That’s why authenticity and regret also play large roles in the film. At one point, Berman, who thinks Johnathan is potentially faking his diagnosis, is so determined to seek the truth that he ends up crossing a line and having a tough conversation with the magician. It was a conversation Berman said he needed to rehearse prior to filming.

“I was really, really nervous,” he said. “Even though Johnathan put a lot of obstacles in my way and would make fun of me, I still considered him as a friend. We were around each other overall 2 1/2 years. It sucks to sit 4 feet away from someone and look them in the eyes and ask them something you know they are going to be offended by.”

Though Berman said the movie takes you on a mental roller-coaster ride, a surprising through line in the film is just trying to do something that makes your mom proud. He added that many Jewish and non-Jewish mothers reached out to him following the documentary’s screening at the Sundance Film Festival, saying how beautiful it was.

“This movie is about the journey, and maybe less about truth and more about humanity with the struggles both in Johnathan’s life and my life … and motivations for why you do things,” Berman said. “There are two pretty flawed dudes up on screen and there’s a lot of humanity there. At the end of the day, you just want your mom to be proud of you, which is so far from where the movie starts.”