As an example of crushingly unfunny comedy, “The Incredible Burt Wonderstone” can only be recommended to masochists and the morbidly curious.

Steve Carell plays Burt, a vainglorious Las Vegas stage magician who squanders enormous public goodwill as his work becomes stale and joyless.

Carell achieved stardom in TV and film roles that mined the awkward, uncomfortable rhythms and painful silences of real life. He’s now backsliding in a hackneyed, overproduced comedy relying on silly costumes, one-note characters, lazy setups and dimwitted punch lines. In other words, the movie provides its own critique.

The problems begin in the first act as we meet 10-year-old Albert, a bullied nebbish who seeks grade-school popularity with tricks from a “Be a Magician” kit created by legendary Rance Holloway (Alan Arkin). The only attention Burt wins is from the equally nerdy Anthony, who becomes his partner in illusions.

Jump ahead three decades to the present and they are Burt and Anton, whose show “A Magical Friendship” has been selling out their casino theater for years. The act is a cheesefest of spangled costumes and corny, overblown theatrics backed by the Steve Miller Band oldie “Abra Cadabra.” Burt and Anton perform with all the verve of a Chuck. E. Cheese animatronic band. There are constant reaction shots as the audience roars in laughter and showers the stars with applause. Audiences are stupid: That’s joke No. 1. Hard luck if you’re expecting another joke.

Popularity notwithstanding, the two are still insecure children inside. Burt, quite carried away with himself, is a jaundiced diva. Hapless Anton (Steve Buscemi) sees their partnership in emotional, rather than financial terms. Buscemi is the heart and soul of the film, embodying the joy and innocence of adolescence. Carell incarnates stupidity, immaturity and sexual obnoxiousness. For an actor specializing in dreamy vulnerability, that’s not great casting.

When guerrilla street magician Steve Gray (Jim Carrey) steals their thunder with acts of bizarre self-mutilation, the duo dissolves its act. We view Anton’s fall with sympathy, but Burt’s with Schadenfreude. While sweetly daft Anton tours the Third World, bringing magic to children’s lives (they really would prefer food and clean water), Burt swiftly slides down the Vegas totem pole. He’s reduced to entertaining residents at a rest home, where he discovers his childhood idol Holloway. The old pro tells the mid-career hack his work is “rote and mechanical,” an observation that will set viewers’ heads nodding in agreement.

“The Incredible Burt Wonderstone,” directed by TV sitcom veteran Don Scardino, aims to skip but merely stumbles. The illusions that pepper the film never seem truly magical, and valuable performers are wasted. As casino mogul Doug Munny (get it?), James Gandolfini smiles all his lines as if willing humor into them. Olivia Wilde, playing Wonderstone’s put-upon magic assistant, is a beautiful blank. In his supporting role, Carrey is the film’s best comedic contributor. His spark of divine madness flickers here and there. When he declaims loopy hipster koans like “Bad things don’t happen to us, they happen for us,” you can almost hear a sitar player noodling mood music. But after 100 minutes of “Burt Wonderstone’s” scant laughs and missed opportunities, you wish it would just vanish down a trapdoor.