Magnolia Pictures(L-R) Marty Rathbun, Louis Theroux meet Paz de la Huerta when she enters their hotel room in a bikini.

In Louis Theroux’s first feature film, “My Scientology Movie” (in theatres Friday), the acclaimed British documentarian travels to Hollywood in the hopes of better understanding the Church of Scientology by investigating its most infamous moments with former members.

But, as it typically goes with a Theroux project, the unknown creates the most compelling footage. And there’s nothing more compelling in “My Scientology Movie” than the hilarious and surprising moment when, in the middle of Theroux doing an interview with former Scientology member Marty Rathbun, actress Paz de la Huerta suddenly hijacks the shoot.

Dressed in a bikini and sipping a water, she is seen in the background walking by the windows of the hotel room where Theroux and Rathbun are shooting. She suddenly stops, knocks on the room’s window, and walks to the room’s door, which Theroux opens.

“You can’t film me,” de la Huerta says, before stepping into the hotel room and talking to the camera.

We’ll let the scene tell the rest of the story:

It’s one of the many stranger-than-fiction moments Theroux has in the movie, but at one point Paz de la Huerta was going to be a bigger part of the film.

As she says in the clip, de la Huerta has been in over 45 films. Many will also remember her from the first two seasons of “Boardwalk Empire” as Lucy Danziger, Nucky Thompson’s girlfriend. (HBO reportedly did not pick up her contract option for a third season.) She’s also become a Hollywood fixture for her sometimes wild behaviour and partying.

But she also has a connection to Scientology, though she is not a member of the church.

The day after de la Huerta barged in on the production of “My Scientology Movie,” director John Dower interviewed her on camera in her hotel room. She revealed that she had participated in a reenactment of an event Scientology founder L. Ron Hubbard used to put on with scientist Jack Parsons after World War II.

“She had taken part in a kind of Magick ritual, a reenactment of a Magick ritual,” Theroux told Business Insider when the film premiered at the Tribeca Film Festival last year, referring to an occult practice.

In the 1940s, before the creation of Scientology, Hubbard and Parsons were part of the California branch of the black-magic cult Ordo Templi Orientis. Parsons used the huge amount of money he got from the Department of Defence for inventing rocket fuel and converted an old mansion in Pasadena into a pagan oasis where strange rituals happened often.

According to Dower and Theroux, de la Huerta said she was the female lead in a reenactment of one of the Magick rituals done in the mansion. It was all part of a performance headed by artist Brian Butler, who is also known as the manager of legendary experimental filmmaker and author Kenneth Anger (“Hollywood Babylon”).

Like any good journalist would, Theroux and Dower followed the story, interviewing Butler and Anger as well as going to Pasadena to film the occult mansion. But looking back on it now, they went too far down the rabbit hole.

“Interviewing Kenneth Anger was fun because ‘Hollywood Babylon’ was kind of a formative book for me back in the day,” Theroux said, “but I thought he was going to link it all up — Hubbard’s Hollywood years with the current religion — but it turned out to be on odd interview.”

Theroux and Dower ended up never using any of the footage in the movie from the de la Huerta lead. But Dower will never forget the last day of shooting de la Huerta.

“She started singing a Charles Manson song,” he said. “I realised then we really went too far down the road with all this, but it was good fun.”