As much as you might want to applaud a movie that tries to be different, “The D Train” takes so many wrong turns that ultimately sheer oddity is mostly what it has to offer. It’s a movie that wants to push the envelope but in the end is so clumsy and cautious about it that the result hardly amounts to a nudge.

It’s also a film that focuses on characters that are meant to be amusingly poignant but come across as irritating, even depressing, instead. The worst is the centerpiece, Dan Landsman (Jack Black), a fellow nearly forty who’s serving on his Pittsburgh high school’s twentieth reunion committee. Dan, a guy who uses fast, fatuously chummy talk in a futile plea for friendship, is shunned by his fellow committee members, who remember him as a clinging bore. Yet he has a supportive wife in Stacey (Kathryn Hahn), a former classmate herself, and a nice 14-year old son named Zach (Russell Posner), though Dan’s dating advice to the boy reflects his own unhappy experiences along those lines two decades ago. He also has a steady job with a local consulting firm, though its owner Bill Shumer (Jeffrey Tambor) is a modern Luddite who shuns such arcane devices as computers and cell phones, making it difficult to keep the business going.

The plot kicks in when, after another dismal night phoning alumni to come to the reunion, Dan happens upon a TV commercial for a sunscreen lotion called Banana Boat, whose pitchman is former classmate Oliver Lawless (James Marsden). That gives him an idea: if he can get Lawless to come to the bash, others will inevitably want to follow his lead. So he invents a phony lead to a big client to persuade Shumer to spring for a trip to Los Angeles to land the deal. There he intends to contact Lawless and use his own imagined powers of persuasion to get him home for the festivities.

Naturally things don’t work out the way Dan wants. Shumer insists on going to California too, and when Lawless agrees to play along by acting the part of the prospective client, his immersion in the role creates a potentially catastrophic situation. Even worse, he and Dan go off for a night on the town that ends in a totally unexpected fashion, causing Landsman to return to Pennsylvania with the intent to prevent Oliver from following him there since his job—and his marriage—could be threatened if he did.

That’s a rather roundabout way of talking about what happens in L.A. that Dan wants to stay in L.A., but to say much more would spoil a plot turn that will have viewers either giggling nervously or grimacing. Had scripters Jarrad Paul and Andrew Mogel had the courage to seize on the twist and run with it, the result might have been something really unexpected, even subversive. But instead they lose nerve and step back, contriving a curiously flat-footed third act that has Dan going off the deep end before a sweetness-and-light conclusion that simply ignores all sorts of unpleasant issues (the future of poor Shumer’s company, for instance) that remain unresolved. They also insert a strange subplot about Zach; it’s not that the old cliché about a boy seeking advice from someone else when his father proves unhelpful, but that the matter Zach’s debating seems calculated to shock the audience, but then is settled in as unobjectionable a fashion as possible. Once again, the writers appear simply to have settled for an easy way out of the problem they’ve posed. And even when the film goes for broke, it winds up feeling more than a little off. That’s certainly the case with what amounts to a showdown between Dan and Oliver at the reunion, which takes a turn it’s simply impossible to accept.

What “The D Train” does have to offer is superlative work from both Black and Marsden. The former proves that what he achieved in “Bernie” was no fluke; Landsman may be the sort of fellow you’d prefer to avoid (as his old classmates do), but Black certainly makes him vividly needy and nagging. Marsden has played shallowness before—in “The 24th Day,” for instance—but here he adds a degree of seediness that’s unusual for him, and he pulls it off brilliantly. The cast is also filled with sharp supporting turns, not merely from the reliable Tambor and Mike White, as one of Dan’s long-suffering old classmates, but from young Posner. There’s also a darkly amusing cameo from Dermot Mulroney as himself, though Hahn is wasted in a bland role. (This is obviously a story about men.) Technically the picture is okay, though as shot by Giles Nuttgens the California-set montages tend to be blurry and the New Orleans locations aren’t exactly a great fit for Pittsburgh.

“The D Train” may be worth seeing for the work of Black and Marsden, and for its initial risk-taking attitude. Unfortunately, the darkness of the humor isn’t sustained, and the film loses its footing in the last act, seeking comforting closure where it isn’t merited.