The briefly amusing high-school reunion comedy-drama “The D Train” gets some things right. The right stuff in this New Orleans-shot project exists mostly in the casting. Late 30-somethings James Marsden and Jack Black respectively co-star as the most popular and most unpopular guys in their high school, class of 1994.

Black’s Dan Landsman fancies himself chairman of the alumni committee that’s organizing a 20th anniversary high school reunion. No one else on the alumni committee agrees with this self-designation on Dan’s part.

“The D Train” gets a promising start as Dan and his former classmates work the phone bank, lobbying their peers to attend the reunion. Dan’s calls do not go well.

“No,” he tells one reunion prospect, “I don’t think I still suck.”

Meanwhile, Dan’s fellow alumni committee members treat him just as badly now as they did back in high school.

Following another unsuccessful might of reunion soliciting, the discouraged Dan gets a brilliant idea. Watching TV in the late-night darkness of his suburban home, he spots a former classmate in a national TV commercial. Oliver Lawless, the coolest guy in high school during the early ’90s. Still cool and handsome, Oliver has become the spokesman for Banana Boat triple defense sunscreen for men.

It’s just a TV commercial. Not a TV series. Not a major Hollywood movie or even a well-received indie film. Nonetheless, Dan gets stars in his eyes. A glorious fantasy that takes hold him. Dan imagines he’ll be the high school hero he never was — if he can get Lawless to the reunion. He tells the alumni committee that he and Lawless were friends in high school. They know it’s a lie.

“The D Train” loses its comic way, taking a grim turn from which it doesn’t return. Dan, hoping to make his dream come true, becomes a serial liar, concocting a scheme to deliver Lawless.

The film leaves it to the audience to guess why Dan so desperately wants to make his fantasy real. Maybe a lifelong of low self-esteem and lingering pain from high school push him to such risky behavior. It would have helped if the filmmakers spelled Dan’s motivation out, illustrated what happened 20 and more years ago. But “The D Train” doesn’t go there.

Dan convinces his computer- and technology-phobic boss, Bill, that he needs to make a business trip to Los Angeles, where a beneficial deal for their company awaits. Of course, the real reason for the trip is to convince Oliver to attend the reunion.

The scheme gets more complicated when Dan’s boss goes to Los Angeles, too. Jeffrey Tambor as Bill is another example of the film’s on-target casting. Tambor makes a fine straight man for Dan’s antics. And Marsden’s Oliver is just too cool for school, aptly handsome and almost poignant in his emptiness.

“The D Train” doesn’t fully exploit its good comic ingredients. Dan paints himself into an anxious, sad corner. As Dan drowns in lies, the film that might have been a farce becomes a tragedy. The downbeat scenario runs out of laughs.

The filmmakers devise a way out Dan’s mess, but the escape doesn’t satisfy. “The D Train” stops short of whatever destination it may have had.