Ewan McGregor in Doctor Sleep.

Stephen King fans know he hated Stanley Kubrick’s The Shining for trivializing Jack Torrance’s alcoholism, and improvising on the evil powers of The Overlook Hotel. Doctor Sleep, King’s sequel to The Shining, seems to exist, in part, to right some of the wrongs King saw in Kubrick’s movie.

Unfortunately, director Mike Flanagan, the man behind the excellent and creepy Netflix series The Haunting of Hill House, made the decision to incorporate Kubrick’s film into his own cinematic adaptation of Doctor Sleep. The results are a mixed bag of genuinely scary moments and passages that make the film too dependent on the glory of Kubrick. Simply put: It’s not a good idea to try to re-create a Kubrick moment without Kubrick’s involvement.

The film starts in 1980, with Danny Torrance riding around the Kubrickian Overlook on a big wheel—and making that dreaded stop at Room 237, where that old lady stayed in the bathtub way too long. The film then jumps ahead to Dan as an adult, played by Ewan McGregor. Dan, like his daddy before him, drinks a lot. He also still has discussions with the now-dead Hallorann (played by Carl Lumbly here). Dan not only still “shines” (communicates telepathically); he also talks to dead people.

The monsters in this movie would be The True Knot, a band of gypsies who look like they are killing time between Burning Man and a Phish concert. Their thing is to hunt down children who can shine, like Danny Torrance did in the original Shining. When they find them, they murder them and eat their essence, which leaves the body as steam. In other words … they are basically vaping not-quite-immortal vampires.

The Knots are led by Rose the Hat (a spooky Rebecca Ferguson), named so because, well, she wears a hat. Rose is the one who rations out the steam for her Knot crew, which they keep in thermoses. This element of the film, along with Ferguson’s disturbing performance, gives Doctor Sleep some memorably scary moments. A sequence in which a young baseball player (Jacob Tremblay, making the most of a few screen minutes) encounters the Knots is as harrowing as anything you’ll see in a movie this year.

In some ways (which I won’t give away), King gets a chance for some do-overs. Some of the scenes and themes in Doctor Sleep reference parts of King’s original novel, as well as the sequel book. King has long bemoaned the ending of the Kubrick’s film, and I can see why he might like the Doctor Sleep conclusion.

Unfortunately, this movie was better when it wasn’t hanging around the Overlook Hotel. The moments in the Overlook, although visually impressive, feel like little more than a stunt, because there’s no real viable reason for the protagonists to be running around in Kubrick’s nightmare. Doctor Sleep works fine when it’s about a nasty band of soul-suckers messing with the kids who have special powers. It’s a confused mess when it tries to do Kubrick. It’s as if this film is trying to provide further relevance and depth to the ghosts and deranged characters who haunted Kubrick’s Overlook—which is simply not necessary. What Kubrick did doesn’t need to be monkeyed with, yet that’s exactly what Doctor Sleep does, especially in the finale. There’s a sequence near the end that is supposed to be the scary payoff, but instead, it led me to unintentional laughs.

McGregor is good in the central role, and Ferguson is fine as the villain. Kyliegh Curran is great as Abra, a young girl who partners with Dan to battle Rose.

Flanagan could’ve cut out much of his expensive Overlook finale—it runs longer than 2 1/2 hours—and he probably would’ve had a better, more cohesive film. Instead, Doctor Sleep winds up being an elaborate imitation of—and a strange sort of King apology for—a classic Kubrick film.

Doctor Sleep is now playing at theaters across the valley.