In “Knives Out,” the writer and director Rian Johnson pays tribute to Agatha Christie and “Clue” in a star-studded whodunit that begins with the mysterious death of the wealthy author and patriarch Harlan Thrombey (Christopher Plummer). Almost every one of his heirs falls under the suspicion of the private investigator Benoit Blanc (Daniel Craig) at some point, including Harlan’s caretaker, Marta (Ana de Armas), a woman so pure of heart, she can’t lie without becoming physically ill. True to the form, no one’s stories seem to add up, the plot thickens, and twists and turns are thrown in and at the center of the movie.

The film has been marketed as a “fun, modern-day” murder mystery, and the many rapturous reviews have echoed this sense of whimsy. But as “Knives Out” unfolds, Mr. Johnson reveals that he’s not interested solely in entertaining his audience for a couple of hours — he has something to say about class and politics in a bold, direct way that is rare in major American studio movies.

Unfortunately Mr. Johnson’s ambitions on this front reminded me that sometimes, well-intentioned art can backfire and offend (and even hurt) those it’s intended to champion. Through the character of Marta, “Knives Out” has a tendency to exploit its story’s immigration angle, which left me feeling uneasy as strangers at the screening I attended laughed at real-life issues I’m genuinely frightened of.

Marta is someone the Thrombeys can show off to make them seem more progressive than they actually are. Eventually, their ease with quoting “Hamilton: The Musical” gives way to a full-on display of their prejudices. None of them seems to know or care where she’s really from, each time guessing a different country. This is played as a running gag that is ostensibly intended as a critique of white upper-class liberalism. Yet Mr. Johnson keeps Marta’s background a mystery to the audience as well, never allowing her any cultural specificity beyond being vaguely Latina . (Ms. de Armas is Cuban.)