One of the most important elements of a successful comedy stand-up routine—or a successful movie—is proper rhythm, and that’s something “The Comedian” sorely lacks. The expository scenes are separated throughout by simple establishing shots and footage of characters merely walking through the streets of New York City, always accompanied by jazzy music provided by Terence Blanchard that comes on like gangbusters. Over the course of two hours the back-and-forth becomes positively deadening.

That’s a problem of pacing. An even more serious one with the film is inconsistency, or simply a failure of nerve. The picture starts out as a portrait of a hard-hearted, cynical, brutally honest insult comic, and for a while it manages to be amusing by showing Jackie Burke (Robert De Niro) as gleefully nasty. But even early on it occasionally offers an indication that he’s really a nice fellow after all, and in the end it turns him into a total cream puff.

The best part of the film, in fact, is the first reel, in which Burke, remembered by most if at all for his starring role in a long-departed sitcom, is accosted by a heckler while doing a set at a nostalgia-themed comedy-club gig. When he attacks the guy (who’s having the confrontation filmed for his own podcast) and is put on trial for assault, his refusal to apologize to the man—indeed, he infuriates the judge by insulting him—earns him a month in the slammer. Though the video of the event goes viral, it doesn’t revive his career.

When Jackie gets out he still has a hundred hours of community service to perform, and at the soup kitchen he meets Harmony (Leslie Mann), who’s doing her hours for going after her unfaithful boyfriend and the woman he was in bed with. They click despite the age difference, first as friends and then in a romantic way that’s a little unsettling. She accompanies him to his niece’s same-sex wedding (where he’s prodded to make some remarks that infuriate his sister-in-law, played like a virago by Patti LuPone, while his brother, played by Danny DeVito, is more tolerant); in turn he accompanies her to a birthday dinner for her father, a sneering ex-gangster played by Harvey Keitel, who tries to run her life. Then Jackie and Harmony have a night together and she leaves to work in her father’s old-age home in Florida.

Though Mann puts a lot of energy into her role, this section of the film doesn’t register as strongly as it should: the writing lacks sharpness and Taylor Hackford’s direction is lackadaisical. But what follows is worse. In Harmony’s absence Burke’s inexplicably dedicated agent (Edie Falco, looking stricken) uses her powers of persuasion to get Jackie a spot on the dais of a televised roast for a so-called comedy legend (Cloris Leachman) despite the bad blood between him and the event’s host (Charles Grodin). Given the talent involved, this sequence should have been a killer. It is, in a literal sense, since it ends in tragedy; but it’s only Burke’s reaction—a complaint that he didn’t get around to using his best material—that really cuts.

There follows Jackie’s journey to Florida for an autograph-signing convention, and a visit to Harmony, who gives him some surprising news (though viewers will probably not be as shocked by it as he is). Of equal importance, though, is an impromptu bit that he does for the geriatric residents, a riff on “Making Whoopie” that he retitles “Making Poopy.” We’re supposed to believe not only that his audience goes wild, but that video of this goes viral too, bringing him such renewed renown that he’s offered the hosting job on a nasty TV game show called “Cry Uncle,” in which contestants suffer humiliation (and physical pain) to win prizes. How Jackie responds to that, and to Harmony’s news, makes him a new man—or reveals, perhaps, the guy he always was. That makes for a sadly conventional conclusion to a movie that wants to be edgy but winds up as sappy and toothless as one could imagine.

De Niro gives the title role his all—which, of course, is considerable—but his gruff, bearlike quality doesn’t prove a perfect fit for it, and his stand-up skill seems distinctly limited. (This was reportedly a passion project for him, and it’s curious that it joins “Silence,” a similar passion project for his frequent collaborator Martin Scorsese, in not reaching its potential.) It’s fun to see such stalwarts as DeVito, Falco, Keitel, Grodin, LuPone, Leachman—and even De Niro’s old co-star Billy Crystal in a cameo—again; but none of them is particularly well used; pedestrian writing and lackluster direction do them all in.

“The Comedian” isn’t an attractive-looking picture: Oliver Stapleton’s cinematography is bland, even in the Florida scenes, and Mark Warner’s editing is bumpy, leading to that oddly unsatisfying rhythm, which is only accentuated by Blanchard’s score, recorded at overloud volume.

Precisely what drew De Niro to this script isn’t clear, but his recent choice of material has hardly been infallible. (Remember “Dirty Grandpa”?) “The Comedian” isn’t terrible, just mediocre—like a stand-up routine that barely earns a chuckle, let alone a belly-laugh.