For his fourth directorial effort, Ben Affleck has chosen to follow up his Oscar-winning “Argo” with an adaptation of Dennis Lehane’s 2012 novel, the second in his series about Joe Coughlin, the son of a Boston police detective who becomes the head of the Italian mob’s Florida rum-running operation during Prohibition. A book by Lehane inspired Affleck’s first film as director, the superb “Gone Baby Gone” (which starred his brother Casey), and he must have hoped that lightning would strike twice. It hasn’t.

Affleck’s first mistake was to write the screenplay himself. He appears to have been overly protective of the material, a rambling narrative of Coughlin’s rise from a self-described “outlaw” veteran of World War I to the chief honcho of Italian boss Maso Pescatore (Remo Girone) in Tampa, leavened by his emotional relationships with a series of lovely women. Apparently unwilling to sacrifice anything, his script devolves into an episodic affair in which segment follows segment with a pattern that would be bewildering if it were energetically handled.

His second error lies in his directorial decision about how to keep the material clear. He departs from the intense style of his previous films in adopting a stately, lugubrious approach that makes for turgidity; even the big action sequences—a car chase in the first reel and the big culminating shoot-out—are choreographed and edited with such staid exactitude that they’re actually quite dull. Jess Conchor’s production design and Jacqueline West’s costumes are unfailingly elegant, Robert Richardson’s cinematography has a burnished glow, and William Goldenberg has cut the film to precise specifications, but the visual result resembles more a series of museum exhibitions than a dynamic drama.

The third problem with “Live by Night” is that Affleck has chosen to take the starring role himself, and to play it with a degree of stiffness that makes Coughlin a one-note character despite his varied experiences. The failing isn’t entirely his: as fashioned by Lehane, Joe is a guy whose qualities are difficult to reconcile. On the one hand, he’s a physically and romantically reckless fellow, putting himself blithely in danger in love and gang war, but he’s also supposed to be a cool, calculating mobster And while he’s adept at killing people, he’s also essentially a man of principle who regrets having to do bad things—both murderous thug and white knight. (He refuses, for example, to take out a young evangelist—a recovering drug addict—whose mission threatens his effort to establish a gambling casino, putting himself in trouble with Pescatore, but wipes out the entire local branch of the KKK, only partially for financial reasons.) Affleck wants to make sure that his gangster is actually a hero, and despite the title his portrayal never digs into the character’s dark side. It’s no surprise that Coughlin favors cream-colored suits and fedoras; it’s like a cowboy who wears a white hat to differentiate him from the villains arrayed against him, and the cliché robs him of the moral complexity Lehane wanted to convey.

It’s not surprising that, given the episodic nature of the narrative, the rest of the cast can do little more than make fleeting impressions, some more effective than others. Girone and Robert Glenister, as Albert White, the head of the Irish mob who becomes Coughlin’s inveterate enemy, don’t rise beyond stock depictions of mob bosses, and Max Casella, as Girone’s ambitious son, is all tics and fake flourishes. Gleeson makes a stalwart authority figure, but that requires little more than an air of ruggedly resigned strength. Better are Chris Cooper, who brings welcome nuance to local Florida sheriff Irving Figgis, with whom Coughlin establishes a tense rapport; Chris Messina, as Joe’s loyal lieutenant; and Anthony Michael Hall, who brings flair to a single scene as a Florida rum dealer Coughlin sends packing. But Matthew Maher is totally over the top as Figgis’ redneck brother-in-law, a vile Klansman Joe knocks heads with.

As if often the case in gangster movies, the actresses do not fare terribly well. Sienna Miller is overly broad as Emma, the flapper-era girlfriend of jealous White, whom young Joe unwisely gets involved with. (That she becomes the love of his life—whom he pines over even after she apparently dies—is a sign that he’s not the brightest guy on the block, though we’re apparently supposed to see his passion for her as a sign of integrity, even if he sees her through rose-colored lenses.) Zoe Saldana can’t do much with the thankless part of Coughlin’s Cuban wife Graciela, who begins by seeming a strong, independent spirit but is eventually reduced to worriedly watching her husband coping with his dangerous colleagues while raising their darling little son. And Elle Fanning is hamstrung by the ellipses in Affleck’s dramatization of the story arc concerning Figgis’ daughter Loretta, an aspiring starlet turned heroin addict and finally evangelist. Her story is told in such sketchy strokes that when it comes to an end, a single conversation between her and Joe is insufficient to give it the emotional punch it is meant to carry.

“Live by Night” runs well over two hours, closing with an epilogue that goes from the merely pedestrian to the utterly bathetic. Affleck’s attempt at an epic gangster saga is a visually handsome portrait of flawed nobility that proves far more flawed than its protagonist. It strives to be a mountain but stubbornly remains a molehill.