In September, Jim Carrey gave one of the better red-carpet interviews in recent memory, when, outside a Harper’s Bazaar party at the Plaza, he said, of his presence at said party, “I wanted to come to the most meaningless thing I could come to.” He then did a quick James Brown impression, before growing more expansive: “I believe we’re a field of energy dancing for itself. And I don’t care.” The interviewer, wide-eyed, tried to steer him back toward Earth, but Carrey wasn’t having it. “There is no me,” he said. It was a moment that blurred the line between person and persona—a rare example of celebrity clarity, or insanity, or else a stunt, or perhaps some of each. As such, it was very much like something that the late comedian Andy Kaufman might have done.

The timing of this interview was fitting, as it came a few months before Netflix’s release of the documentary “Jim & Andy: The Great Beyond,” which chronicles Carrey’s acclaimed performance as Kaufman in the film “Man on the Moon,” from 1999. The documentary, directed by Chris Smith, is getting attention for its footage of Carrey’s method acting on the set of the original film, which portrayed the life and career of Kaufman, from his childhood on Long Island; to his role as Latka, on “Taxi”; to his conceptual, often surreal stage comedy. Carrey stayed in character for the entire shoot, either as Kaufman or as Kaufman’s vulgar lounge-lizard alter ego Tony Clifton—going so far as to wear a paper bag over his head when he wasn’t wearing the prosthetics and makeup needed to play Clifton. By 1999, Carrey was one of the biggest movie stars on the planet; he’d worked as a standup comedian for more than fifteen years before surging to mass popularity, in 1994, with the gross-out comedy “Ace Ventura: Pet Detective,” which was followed by a string of hits in a similar vein. In 1998, he took on his first dramatic role, in the “The Truman Show.” Carrey says, in “Jim & Andy,” that Universal, the studio behind “Man of the Moon,” had tried to bury the backstage footage in order to protect his movie-star image—“so that people wouldn’t think Jim is an asshole.”

There are plenty of “asshole” moments taken from the more than hundred hours of footage, which was shot by Kaufman’s longtime girlfriend, Lynne Margulies, and his confidant Bob Zmuda. Carrey, as Kaufman, makes life hard on the Oscar-winning director Milos Forman, who is left pleading with him to coöperate. As Tony Clifton, he crashes a convertible on the lot and berates the crew, blares music in the makeup trailer, and barges into the offices of Steven Spielberg, demanding to talk about “Jaws.” Carrey antagonizes the wrestler Jerry Lawler—who famously sparred with Kaufman and who appears as himself in the film—leaving Lawler genuinely confused (he and Kaufman had been friends) and later provoking him to violence. For Carrey, Clifton was an especially natural fit: there has always been something bullying in Carrey’s performances, a bold physical and emotional insistence that is at once alluring and off-putting—a mixture of aggression and vulnerability that dares you to look away, or to judge and dismiss, but also makes you afraid to do it, or feel bad for wanting to.

What’s even more compelling than this unseen footage is the extended contemporary interview with Carrey that Smith uses to structure the documentary. Sporting a black leather jacket and a full, luxuriant achievement beard, Carrey insists that his role as Kaufman was less a matter of acting or impersonation than the result of a possession. After he was cast in the movie, he says, he attempted to communicate telepathically with Kaufman, who died, of cancer, in 1984, and looking out over the ocean he saw “like thirty dolphins” rise out of the water. “That’s the moment that Andy Kaufman showed up, tapped me on the shoulder, and said, ‘Sit down, I’ll be doing my movie,’ ” Carrey says. “What happened afterwards was out of my control.” Then he stares straight at the camera with an insistent sincerity in his eyes and the hint of a smirk on his lips, daring you to doubt him.

It’s a put-on, of course—a joke akin to Kaufman’s insistence that he and Tony Clifton were different people. Or is it? In the documentary, Carrey speaks with phrases seemingly pulled from a grab bag of New Age spirituality. He talks about visiting, in the early nineties, a psychic who predicted his big break in Hollywood. He tells an old story about how, around the same time, he wrote himself a check for ten million dollars “for acting services rendered” and, within a few years, had earned that and more. (Smith includes a clip of Carrey, in 1997, telling that story to Oprah, who, years before her own infatuation with “The Secret,” appears to understand perfectly.) He recalls praying to God for a bicycle as a child and having it almost magically appear in his living room. From that point, he says, with no hint of irony, “whenever I wanted something to happen, I manifested it.”

Carrey’s ideas may strain credibility, but they lead him to worthwhile insights into his work as an actor and comedian. Carrey recalls an epiphany he had during the early stages of his own standup career. He had struggled to determine what the audiences who watched him wanted, and one night, he says, he shot out of bed with the answer: “They want to be free from concern.” The best way to provide that kind of transporting release, he decided, was to become free from concern himself onstage—to lean into his maddest physical and mental instincts, and to give himself fully over to what he refers to as his Hyde, a latent personality devoted to pleasing others by exploring the outer extremes of performance. Think of all his faces, tics, catchphrases, and pratfalls—the disfiguring and humbling of his body in front of others for their delight and approval. It was the stuff that launched him to superstardom. It was also, he says elsewhere in the documentary, while in character as Kaufman, a kind of cowardice, the manifestation of his desire to be liked by everyone.

This confession injects a fascinating tension. Kaufman, after all, was lionized specifically for his comedic bravery—for his seeming disregard for the audience and compulsion to follow his ideas to their own, often unsettling ends. His combination of passivity and hostility on “Letterman,” his deadly earnest Elvis impersonation, his odd forays into pro wrestling all seemed designed to generate immense concern in those watching him perform.

Carrey reveres the mythology that surrounds Kaufman’s risk-taking, and seems to lament his own unwillingness to take things as far. During a re-creation of a wrestling match between Kaufman and Lawler for “Man on the Moon,” Carrey goaded Lawler to attack him and then, much like Kaufman had done, pretended to be severely injured. Carrey was taken from the set on a backboard and driven away in an ambulance; his manager went out to read to the press a statement blasting Lawler. The whole thing, a creation of Carrey’s alone, made it on the nightly news. Yet he couldn’t keep the secret that it had been a hoax. “I probably should never have told people,” he says. “I’m not the same personality as Andy—Andy would never tell you.” Carrey, however, undersells the key elements that he and Kaufman share. Though they operate mostly on different registers, there is, in both performers, just beneath the surface, a palpable rage, an almost cruel compulsiveness that makes you wince as much as laugh.

“Jim & Andy” finds Carrey in an intriguing place, what he calls “a quiet, gentle seat in the universe.” Other than a sequel to “Dumb and Dumber,” in 2014, he hasn’t had a major movie role since 2011. “I don’t want anything,” Carrey says. “I have no ambition.” By telling the story of the actor’s career in rough parallel with the footage from “Man on the Moon,” Smith has created a narrative of multiple disappearing acts: a story not only of Carrey’s disappearance into the character of Andy Kaufman but of Carrey’s earlier disappearance into the role of a public, popular performer. Now Carrey is contemplating a further disappearance, the erasure of that popular persona—what he meant, perhaps, when he insisted to that fashion reporter that he had ceased to exist. But it’s slippery ground. Becoming someone entirely new is exactly the kind of thing that you’d expect Jim Carrey to try—and he seems to remain enlivened by performance. “I wonder if I could do that with other people,” he muses, reflecting a final time on his inhabitation of—or cohabitation with—Kaufman. “I wonder what would happen if I decided to just be Jesus.” Then he smiles, and lifts a mug of tea to his lips, with that famous and worrying glimmer of mischief in his eyes.