Jim Carrey stretches in “Dark Crimes,” and it’s a painful thing to watch. The actor’s performance in a darkly dramatic role is stiff, shallow and dull. It’s not entirely his fault, though; the film would be a misguided mess no matter who had taken the lead.

Jeremy Brock’s screenplay was obviously inspired by the case of convicted Polish murderer Krystian Bala, which was the subject of a New Yorker article (“True Crime,” the original title of the script) by David Grann in 2008. Bala, a self-styled intellectual and failed businessman, had killed his ex-wife’s lover and then left the country. While traveling abroad, he wrote a novel titled “Amok” that he posted on an internet blog, in which he fictionalized elements of his crime. That led dogged investigators to label him a suspect years after the fact, arrest him after his return to Poland, and gradually build a case against him that prevailed in two separate trials. A solid English documentary of the case—a fascinating one—is available on YouTube.

Brock takes the novel-based aspect of the case—and the Polish setting—and confects a cliché-ridden surrounding narrative out of thin air. Carrey plays Tadek, a world-weary detective who’s been shunted off to the sidelines because of some vague earlier professional mistake. An outcast at work who’s also treated disdainfully at home by his sullen wife (Kati Outinen), the perpetually gloomy fellow—who is also shown regularly visiting his frail mother (Anna Polony)—seeks redemption, and hopes to find it in a notorious cold case in which a famous man was found, bound and half-naked, in a river. He was known to have been a regular patron at a sex club called The Cage.

Assigned a callow factotum named Wiktor (Piotr Glowacki), Tadek digs into things and identifies a suspect: famous writer Kozlow (Marton Csokas), whose latest book hasn’t been published in print but is available in audio format (an unlikely state of affairs probably imagined to avoid dull readings off computer screens). Listening obsessively to that text, even at home to his wife’s consternation, he finds in the book revealing parallels to the murder. So he calls Kozlow in for questioning, especially since at the time he’d had a flat near the club.

But that’s only the beginning. Tadek will also connect with Kasia (Charlotte Gainsbourg), a woman with whom Kozlow has a close relationship. A sad-faced single mother with a young daughter, she obviously is frightened of something, but is afraid of saying too much.

Then there are Tadek’s superiors. The fellow who assigned him the case (Vlad Ivanov) seems to have his best interest at heart, but the chief (Robert Wieckiewicz) is hostile—perhaps because he had something to do with closing the case in the first place.

As directed, with plodding deliberation, by Alexandros Avranas (with equally ponderous editing by Agnieszka Glinska), and shot in monochromatically dank tones by Michal Englert (with some grainy video of the sex club interspersed to accentuate the decadent, “Hostel”-like atmosphere), “Dark Crimes” lumbers its way to a predictable conclusion, but its most grating element is Carrey’s broodingly boring performance as the proverbial last honest cop in the department. He spends most of the film staring into the camera, presumably in an effort to suggest a broken man pondering both his own past and the details of the murder he’s investigating. But his gaze is so blank that it conveys northing. By contrast both Csokas and Gainsbourg play to their usual strengths—he’s loud and glowering, she’s recessive and fragile. It is not the finest hour for either. The supporting cast is fair.

The Bala case is an extremely interesting one, and if this film had stuck closer to the facts, it might have possessed a cunning Highsmith tone. As it is, though, if it comes to charges being leveled, all those associated with “Dark Crimes” should be indicted for the cruel and unusual infliction of tedium.