There’s not much cinematic magic in this tale of an arrogant Las Vegas magician who learns the virtue of humility, but there are some good laughs and a few great supporting performances. That’s enough to make “The Incredible Burt Wonderstone” a genial but uneven feature-length sitcom, not unlike the recent Will Ferrell-Zach Galifianakis vehicle “The Campaign.” It may be more “The Merely Okay Burt Wonderstone,” but as Frank Loesser observed, mediocrity is not a mortal sin.

Steve Carell plays the title role, the dominant half of a duo that also includes wimpy Anton Marvelton (Steve Buscemi) and has become a popular staple at the Vegas casino run by Doug Munny (James Gandolfini). The partners bonded in childhood, when bullied Burt (Mason Cook) embraced the cheesy magic kit sold by prestidigitator Rance Holloway (Alan Arkin) and even-nerdier classmate Anton (Luke Vanek) became his biggest fan and collaborator. Their joint childhood hobby turned into a major career.

In the process, however, Burt has become an insufferable jerk, treating Anton with disdain and exploiting their long line of female assistants for his own libidinous purposes—until, that is, he hires Jane (Olivia Wilde), a no-nonsense gal with sleight-of-hand ability of her own who gives him the brush-off. Worse, their act has gotten stale, and the crowds willing to pay to see it increasingly sparse. Enter Steve Gray (Jim Carrey), an edgily new-style Internet magician who emphasizes physical self-abasement over conventionally good-natured tricks—sort of Chris Angel squared. In trying to beat him at his own game, Burt and Anton indulge in a very public endurance display that ends badly and tears the team apart. Left on his own, Burt, oblivious to reality, is soon fired and hits rock bottom with a gig in a retirement home.

It’s there that he’s reborn after meeting Holloway, one of the residents, who instills in him the childlike wonderment in magic that he’d lost over the years. After coming up short against Gray in a contest at a kids’ birthday party, Burt reunites with Anton and, with Jane at their side, they challenge Gray for a permanent slot at Munny’s extravagant new casino, attempting a trick that will involve—and amaze—the entire audience.

Compared to a movie like “The Prestige,” which treated the magic trade with a sort of hammy solemnity, it’s nice to encounter one that drops any hint of pomposity and just emphasizes the hamminess and glitz. Burt and Anton’s act is like Siegfried and Roy without the big cats—a composite of spangled costumes, goofily bombastic music, silly dance moves, bubblehead patter and elaborate, loud effects. The whole thing is a send-up of old-style Vegas vacuity, a subject that’s rich in sharp satiric possibility but is here treated with a very broad comic brush instead.

And that’s the major problem with the movie—like the set-in-their ways Burt and Anton, as directed by Don Scardino it takes no chances, going for easy laughs with obvious overstatement when a more subtle approach would have unearthed a richer vein of humor. Carell’s character is at first just like Michael Scott taken to the ultimate—a boorish, preening egotist totally lacking in self-recognition, and his redemption through failure is a hackneyed plot device. Carrey’s part is even worse in that Gray isn’t really a magician at all—he’s just a deranged guy who endures physical torture for the sake of fame, and the manic intensity with which Carrey plays him makes him more scary than funny.

But there’s compensation, too. The prologue featuring the elementary-school versions of Burt and Anton is charming. The last-act gag about the team’s ultimate trick might strain credulity, but it possesses a certain darkness that’s welcome. Wilde is pleasant, and the bumbling, amiable Buscemi more than that, even if a bit about his post-career philanthropic work sounds more amusing than it actually plays. Best of all there’s Arkin, in another supporting role that the veteran actor uses to steal every scene he’s in. One can only imagine what a film about Rance Holloway might have been like—probably a good deal better than this one.

Still, given the mostly abysmal run of contemporary Hollywood comedies, you have to be grateful for small pleasures, and that’s what “The Incredible Burt Wonderstone” provides. Technically proficient but not outstanding, it will hardly amaze you but should elicit a few chuckles on the way to its predictable outcome.