Here’s a recipe for disaster: Take a movie star known for indulgent, self-destructive antics on and off the set, send him to rehab, turn his therapeutic writings into a score-settling screenplay centering on his relationship with his deeply troubled father, then produce the movie — with said actor playing his own dad.

What could go wrong?

Well, surprise: “Honey Boy,” Shia LaBeouf’s startlingly forthright, cathartic and beautifully acted movie based on his confusing and chaotic life as a child actor, winds up demonstrating what can go right, when the right elements are in place.

As “Honey Boy” opens, an actor named Otis (Lucas Hedges) is staring into the camera, saying, “No, no, no, no, no,” until he’s thrown back into an exploding fireball. What we’re witnessing is a piece of movie magic that is quickly deconstructed as the wires and stunt coordinators and special effects come into sharper view. We’re also witnessing LaBeouf’s satirical nod to the “Transformers” movies that made him a star (and in which his repetition of the word “no” inspired an internet meme).

In a lurid montage, Otis spins out of control, landing in a facility where his actorly tricks are stripped away, forcing him to confront the discomfiting truths that have made him, as he says, “an egomaniac with an inferiority complex.”

Most of “Honey Boy” consists of Otis’ flashbacks to when he was 12, starring on a television sitcom and living in a shabby Los Angeles motel with his father, James, a bespectacled free spirit whose rebelliousness often gives way to antisocial hostility, and whose own thwarted ambitions as a performer find a sadistic foil in the gifted young son he simultaneously cheers on and ruthlessly undermines.

In the endearing road comedy “The Peanut Butter Falcon” earlier this year, LaBeouf reminded viewers that, despite his tabloid persona, he’s still a commanding and intensely watchable actor. Here, he proves his thoroughgoing commitment yet again, in what must be one of the toughest roles of his life. Delving as deeply into his father’s vulnerabilities as his demons, he makes James into a narcissistic monster, a good ol’ boy who affects the bookish, bohemian persona of David Foster Wallace while nursing a breathtakingly abusive mean streak. Four years sober, James still evinces the volatile mood swings of the classic dry drunk, one minute cruelly demeaning young Otis (played with heartbreaking guilelessness by Noah Jupe), the next teaching him how to juggle with pairs of rolled-up socks.

Toggling between Otis’ therapy and his most searing memories, “Honey Boy” begins to take shape as something deeper than just a chronicle of one man’s dysfunctional upbringing. What Otis — or LaBeouf himself — might have once been tempted to toss off as a colorful, or at worst “tough,” time growing up becomes something far more damaging, as he realizes that the sense memories and reference points he relies on to do his job involve excavating profound trauma — as well as the realization that what didn’t kill him might have made him a better actor. (The film’s most revelatory and anguishing scene features young Otis playing the part of his own mother as he acts as her go-between during an argument with his dad.)

Directed with sensitivity and insight by Alma Har’el, “Honey Boy” tells a universal story of how adult children navigate the impossible bind of surpassing their own parents without annihilating them — made all the more difficult when burdened by the parents’ own unresolved afflictions. But with its vivid atmosphere and behind-the-scenes candor, “Honey Boy” becomes something more specific and piquant, peeling back the veil on pop entertainment to reveal its artifice and profound physical and emotional toll.

In this intense, unsettling, modestly triumphant portrait of the artist as a young man, LaBeouf shows us not only how he grew up, but what it cost him along the way.