Paul Tremblay’s 2018 horror novel, The Cabin at the End of the World, has an undeniably chilling setup: While vacationing in a remote cabin in New Hampshire, a gay couple, Andrew and Eric, and their adopted daughter, Wen, are victims of a terrifying, violent home invasion by four people, all armed with bizarre bladed weapons. Their spokesperson, an imposingly large but seemingly gentle man named Leonard, insists that they don’t wish them harm; they just have something very important that they want to discuss. The end of the world is coming, he says, and the only way it can be stopped is if the family willingly sacrifices one of its members. They’ll have four chances to do so, he says, and if they refuse all four times, everyone on Earth will die—as tsunamis, pandemics, and other cataclysmic events are unleashed upon the world. The same premise drives a new theatrical film adaptation, Knock at the Cabin, directed and co-written by The Sixth Sense’s M. Night Shyamalan, that takes the story in a new and, frankly, distasteful direction. It premieres on Feb. 3.

Both book and film are almost entirely taken up with the tense, upsetting hostage situation in the cabin. Almost immediately, Andrew and Eric suspect that the cultish zealots have a gay-bashing motive, which they all repeatedly deny; one awkwardly claims that there’s “not one homophobic bone in my body.” Understandably, the couple doesn’t believe them. (Eric’s backstory includes the fact that he was victim of a hate crime in the past, which has a direct effect on the story later.) It should be easy to hate four strangers who break into a family’s home, terrorize a small child, and tie her parents to chairs, spewing a gospel of self-destruction. But before long, the story takes a weird turn, and one starts to wonder if maybe, just maybe, there’s something to the torturers’ freakish beliefs. Maybe they are working to avert the end of the world, after all.

This leads to moral questions that the story seems ill-equipped to address. What it seems to say is that, in certain circumstances, victimizing gay people and small children is absolutely justified; if you’re on the side of righteousness—and what could be more righteous than saving the world?—then you’re free to commit any abominable act. This is, of course, nauseating stuff, and neither the book nor the movie really manages to grapple with it.

Tremblay, at least, tempers it all by keeping the ending of the story somewhat vague, and by never having Andrew and Eric buy into their captors’ end-of-times beliefs. But Shyamalan makes very different choices, rewriting the latter part of the story; different characters live and die, and, more significantly, all questions are tidily answered in a clumsy, simplistic resolution.

The film’s ending, unfortunately, undermines the truly fine work that several of the actors do. Mindhunter’s Jonathan Groff, as Eric, and Pennyworth’s Ben Aldridge, as Andrew, offer sensitive, detailed performances, and they—along with charming newcomer Kristen Cui, as Wen—deliver a portrayal of an incredibly appealing family. Their antagonists, including Avenue 5’s Nikki Amuka-Bird, Mad About You’s Abby Quinn, and the Harry Potter films’ Rupert Grint, are edgy and often riveting, and Dave Bautista, as Leonard, anchors some truly affecting scenes. It’s a shame that Shyamalan, in one of his trademark twists, put them all in the service of something so twisted.

David Rapp is the senior Indie editor.