Garry Shandling wasn’t easy to classify in life. He was a widely admired stand-up comic and a creator of two influential TV series: “It’s Garry Shandling’s Show,” a self-aware deconstruction of the sitcom form, and “The Larry Sanders Show,” a blistering behind-the-scenes look at a fictional late-night program.
But he was more closely associated with a certain comedic tone — a relentless self-scrutiny that he passed off as self-absorption — than with any particular gag or punch line.
When Mr. Shandling died of pulmonary thrombosis in 2016 at the age of 66, it shocked fans and fellow comedians who had looked up to him, few of whom had known that he had been experiencing health problems. He had no spouse and no children, and it was not clear who would look after his legacy, let alone what that legacy might be.
For a memorial service, Judd Apatow, the filmmaker and producer (“Knocked Up,” “The 40-Year-Old Virgin”) and one of Mr. Shandling’s many disciples, immersed himself in his mentor’s past stand-up routines and interviews, which he edited into montages. After listening to other friends and comedians reflect on Mr. Shandling at the service, Mr. Apatow became convinced there was still much more of a story to tell about him and his impact.
“Everyone talked about sides of Garry that most people didn’t know,” Mr. Apatow said. “I thought Garry would have wanted to talk about all of this, but hadn’t figured out a way to do it.”
The many facets of this celebrated but underexamined performer are explored in Mr. Apatow’s documentary “The Zen Diaries of Garry Shandling,” a four-and-a-half-hour film that HBO will show in two parts on March 26 and 27.
Mr. Apatow’s film traces its subject’s lifelong process of putting himself under the microscope, an occasionally transcendental journey on which Mr. Shandling became fascinated with Zen Buddhism and kept introspective journals.
The documentary is also an unvarnished look at a series of events that took a cumulative toll on Mr. Shandling, including his acrimonious breakup with his ex-fiancée, Linda Doucett; his lawsuit against his powerful ex-manager, Brad Grey; and his discovery that he had been targeted by Anthony Pellicano, the notorious Hollywood private investigator.
“I wanted to do right by Garry,” Mr. Apatow said. “But right by Garry doesn’t mean making Garry look great. It means getting to the truth, because that’s all he ever cared about.”
As a teenager, Mr. Apatow had interviewed Mr. Shandling for his high school radio show; he became a joke writer for him in his early 20s and later a producer for “The Larry Sanders Show.” Over the years, he developed a unifying theory about Mr. Shandling and his work.
“He was fascinated by the ego it takes to be in show business,” Mr. Apatow said. “He was mature enough to see it in other people and in himself. But at the same time, he also had problems with ego and losing yourself in your quest to succeed.”
To create his film, Mr. Apatow delved further into Mr. Shandling’s archival footage, as well as documentary projects Mr. Shandling had pursued and aborted: one on the basketball games he held with other comedians at his house, and one specifically about his diaries.
Mr. Apatow also spoke to many of Mr. Shandling’s confidants, including Ms. Doucett, who had reconciled with him in recent years. “I never stopped loving Garry and I never stopped protecting him, not ever,” Ms. Doucett said.
Even so, Ms. Doucett said she found it challenging to conduct her interview for the documentary at the home she and Mr. Shandling had once shared. “I was still grieving,” she said. “I hadn’t been back there since he died. I’m like, are you kidding? I took an extra Lexapro. My mouth was so freaking dry.”
Mr. Apatow learned crucial details about Mr. Shandling’s upbringing in Tucson, and his devotion to his older brother, Barry, who died of cystic fibrosis when he was 13 and Garry was 10. His mother became inordinately devoted to her surviving son, an obsessiveness that Mr. Shandling often recounted in his stand-up act.
Colleagues who knew Mr. Shandling during the 1970s and 80s, as he gained recognition as a stand-up and guest host of “The Tonight Show,” said that beneath his stage persona of a neurotic, superficial bachelor was a man with a sincere curiosity about spirituality.
“He was the first person I knew who was into crystals and had a cabin in Big Bear,” said Alan Zweibel, who created “It’s Garry Shandling’s Show” with him. “He’d said, ‘Let’s go to that restaurant because it’s got good energy.’”
Whether he was fixated on a routine or a romantic entanglement that he couldn’t get just right, Mr. Shandling could be an exhaustive, exhausting conversationalist.
“He would ask your advice and you’d be up with him until 2, 3 in the morning, thinking that you’d made some sort of point,” Mr. Zweibel said. “And then you’d find out, when you went to sleep, he called somebody else with the same question.”
By the late 1980s Mr. Shandling was in a long-term relationship with Ms. Doucett. With the debut of “The Larry Sanders Show” on HBO in 1992, he seemed to have cemented his reputation as a peerless satirist of Hollywood vanity, and he blithely passed on offers from broadcast networks to host legitimate late-night programs.
But in the ensuing years, it all unraveled. In 1994, Mr. Shandling broke up with Ms. Doucett; he also fired Ms. Doucett from “The Larry Sanders Show,” on which she played the airheaded assistant to the host’s sidekick, portrayed by Jeffrey Tambor. Ms. Doucett sued Mr. Shandling for sex discrimination and sexual harassment, and the case was later settled out of court.
In the fallout from that conflict, Mr. Shandling sued Mr. Grey for $100 million, claiming that Mr. Grey had double-charged him for fees as both his manager and an executive producer of “The Larry Sanders Show.” That case, too, was eventually settled, but as it progressed, Mr. Shandling learned he was being monitored by Mr. Pellicano, who was often employed to dig up dirt in high-profile show-business conflicts.
(In 2008, Mr. Pellicano was convicted on numerous counts, including wiretapping and intimidation, and sentenced to 15 years in prison; he is scheduled to be released next March. Mr. Grey, who testified that he was unaware of Mr. Pellicano’s illegal activities, died in 2017.)
Mr. Shandling, who testified against Mr. Pellicano at his trial, was never the same after these experiences, his friends said.
“It made him so disenchanted with the business and with life, because he saw a side of things that was so ugly,” said Kevin Nealon, the actor and comedian. “And it did damage him. It damaged his optimistic outlook on life.”
Mr. Shandling would still engage in occasional acts of selflessness, like showing up in Hawaii to offer Conan O’Brien emotional support after Mr. O’Brien left “The Tonight Show” in 2010. (“My wife was like, ‘My husband’s off with Garry Shandling, having this romantic getaway,’” Mr. O’Brien recalled.)
But in successive appearances on his talk shows, Mr. O’Brien said he saw Mr. Shandling retreat further into himself.
“Really good artists are self-critical,” Mr. O’Brien said, “but you need the right ratio, where 70 percent is the creative push forward and 30 percent is the self-critical push back.”
He added: “As Garry went on, it would be, O.K., now he’s 50 percent self-critical. Now he’s 60 percent self-critical. He was getting a little enveloped in self-criticism.”
In the final months of his life, Mr. Shandling was given diagnoses of hyperthyroidism and pancreatitis and underwent major surgery. “There were periods where he was foggy,” Mr. Apatow said. “Then he would come out of it and suddenly be hilarious and sharp.”
Many friends and loved ones felt that, in conversations from this time, Mr. Shandling was making his final peace with them. He died on the same day he learned HBO had closed a deal to buy back the rights to “The Larry Sanders Show.”
Mr. O’Brien recalled feeling at Mr. Shandling’s memorial service that, while his TV shows had secured their place in the comedy pantheon, the man behind them still needed to be preserved.
“There’s a danger with Garry that people will forget,” he said. “His work was so good, but it was so specific. There are some icons that take care of themselves when they pass away — there’s a larger institution that carries them on.”
With this documentary, Mr. O’Brien said, “Judd is sticking up for Garry in a way.”
So when Mr. Apatow delivered to HBO a film that was roughly 270 minutes long, the network didn’t flinch, a reflection of how crucial Mr. Shandling and “The Larry Sanders Show” had been in establishing HBO’s legitimacy as a broadcaster.
The series “had a huge catalytic effect in the creative community,” said Richard Plepler, HBO’s chairman and chief executive, who had just started his career there when “Larry Sanders” was in its pilot stage.
“It was a watershed moment in the history of our company,” Mr. Plepler said. “It opened many, many doors for artists to come in and paint on our canvas.”
Mr. Apatow now understands that making “The Zen Diaries of Garry Shandling” was a way to work through his grief. Mr. Shandling had been generous and funny, but now, Mr. Apatow found himself yearning for his crankiness, too.
“I used to say working with Garry was like trying to paint with Picasso,” Mr. Apatow said. “And then Picasso would look at you and go, ‘What are you doing? Why aren’t you doing it as well as me?’”