After finding a starring vehicle that suited her perfectly in last year’s “Spy,” Melissa McCarthy stumbles—often quite literally—in “The Boss,” a scattershot farce that resembles a short-form sketch stretched to inordinate length, especially in a last-act confrontation that’s both ill-conceived and abysmally executed.

The movie starts with a brief prologue showing Michelle Darnell as a child being repeatedly returned by prospective adoptive parents to the orphanage run by a long-suffering nun (Margo Martindale). It’s quickly established, however, that on leaving the place she became a wealthy tycoon with sass to match her bank account. Having transformed herself into the self-proclaimed 47th-richest woman in America, she not only knows all the ins-and-outs of Machiavellian investment but shares them with scads of followers through self-help books and elaborately-staged seminars. But she treats her staff, particularly her footstool assistant Claire (Kristen Bell), like dirt, and in the process of ascending the ladder has made an enemy of her former lover Ron, or Renault (Peter Dinklage), another titan of finance, who takes his revenge by turning her in for insider trading. Sent away for a few months’ jail time, she emerges with her lack of principles, as well as her devotion to creature comforts and her perpetually snarky attitude, intact, but without any resources, since all her money and property has been seized by the government.

That brings her—after a long trudge through the streets of Chicago—to the doorstep of the cramped second-floor apartment where Claire, now stuck in a thankless job under nasty supervisor Dana (Cecily Strong), lives with her adolescent daughter Rachel (Ella Anderson). Claire agrees to let her crash for a couple of nights while she tries to reconnect with old business associates, but under Renault’s instructions they rebuff her, and the visit drags on indefinitely.

Darnell’s inspired to undertake a new business venture, however, by a fortuitous accident: after tasting one of Claire’s delicious homemade brownies and then accompanying Rachel to a meeting of her cookie-selling scout troupe, the Dandelions, she determines to form a bunch of young salesladies, Darnell’s Darlings, to hawk packages of Claire’s chocolaty confections door-to-door on commission. The operation brings the Darlings into conflict with the Dandelions, led by prune-faced harridan Helen (Annie Mumolo), but Michelle’s endless confidence—as well as her willingness to curse a blue streak and throw a punch or head-butt when required—win the day, and after she secures funding from her old mentor (Kathy Bates), it looks as though the sky’s the limit for her new brownie empire.

Naturally obstacles arise. Renault intervenes to cause a rift between Michelle and Claire. More importantly, though, Darnell’s resistance to the very notion of having a surrogate family—left over from her unhappy childhood, of course—causes her to distance herself from Claire and Rachel. Soon the new venture winds up in Renault’s hands, and to save the situation Michelle, Claire and the latter’s recently-acquired boyfriend, a likable but goofy co-worker (Tyler Labine), are compelled to sneak into Renault’s penthouse office to steal a signed contract, a heist attempt that leads to that catastrophic final brawl, complete with Samurai swords, between Darnell and her one-time squeeze.

Obviously there’s a substantial dose of treacle in the recipe concocted here by McCarthy, her husband Ben Falcone (who also directs), and their co-writer Steve Mallory: as soon as one sees Rachel, it’s inevitable that she and Darnell will end up closer than most real relatives. But much of the would-be humor in “The Boss” is based on Michelle’s abrasive, abusive language, which takes the picture deep into R-rated territory, and some gratuitously raunchy stuff—especially toward the close—that seems predicated on the “see how far we can go” principle. When that fails, the picture resorts to violent slapstick—Darnell’s encounter with a sofa-bed and a long flight of stairs, obviously done with not-very-good CGI, or what’s meant to be a centerpiece, a street fight between the Darlings and the Dandelions that drags on much too long—or simple mugging (as in a teeth-cleaning sequence early on or a meal involving a Japanese puff fish later on, a gag that should really be retired). There are also a queasy sequence in which Michelle self-tans in Claire’s bathroom, and an oddly protracted scene in which Michelle and Claire feel up one another’s breasts, which one might find more unsettling than amusing. The movie reaches its nadir, however, in the final twenty minutes, when Darnell and Renault go at it with swords as Claire looks on. Bell appears aghast at what’s happening, and you’ll probably share her distress.

Of course McCarthy can bring some sparkle to even the dreariest material, and it’s nice to see her play a well-dressed, sophisticated woman for a change; but however hard she tries, she can’t make Darnell much more than a foul-mouthed cartoon. Nor does she get much help from the supporting cast. Bell and Anderson are simply bland ciphers, and talented farceurs like Labine and Strong are wasted (as is Bates, in what amounts to a cameo). Mumolo fares somewhat better, though the character is a shrill caricature, and Kristen Schaal has a few good moments as the Dandelions’ weepy den mother. But the treatment of Dinklage shows once again that filmmakers have little idea how to use him: as in “Pixels,” he’s asked to act creepy, which he certainly can manage but brings few laughs. You have to go back to “The Station Agent” to discover all he has to offer, but of course it was directed by Tom McCarthy, who’s in a completely different category from Falcone, who focuses the camera on his wife and just lets her riff. The technical side of things is just adequate, though cinematographer Julio Macat does manage some nice shots of Chicago locations.

Oddly enough, one of the movie’s producers is Will Ferrell, who himself used the idea of a well-heeled person’s being sent to prison in the recent “Get Hard.” It didn’t work terribly well in that instance, either.