Much like former Supreme Court Justice Potter Stewart’s legendary line about pornography, comedy is an “I know it when I see it” proposition. Nothing will kill a joke faster than trying to analyze it, and The Incredible Burt Wonderstone offers a useful teaching moment in comedy principles.

The Incredible Burt Wonderstone seems to have a firm grasp on this concept right from its opening shot, as a young boy named Burt Weinzelstein runs in slow motion, with sweeping nostalgic music swelling in the background. But he’s not happy — he’s being pursued by a bully, and finds his way home for a solitary birthday where his sole present is a magic kit and instructional video by magician Rance Holloway (Alan Arkin). This boy and his childhood best friend, Anthony, grow up to be legendary Las Vegas illusionists Burt Wonderstone (Steve Carell) and Anton Marvelton (Steve Buscemi) — but 10 years into their run at Bally’s casino, they’re seemingly just going through the motions. As we get a glimpse of the narcissistic Burt in his lavish suite, screenwriters Jonathan M. Goldstein and John Francis Daley (Horrible Bosses) seem to be setting up a rise-and-fall-and-re-rise tale that would make Burt Wonderstone the Anchorman of the magic world.

The gags over the course of the first hour are somewhat erratic, but plenty of them are on target. A throwaway bit finds Jay Mohr as a sad-sack of a would-be “comedy illusionist” who can’t put together a coherent punch line. A fight between Burt and Anton leads to Burt’s desperate attempt to adapt one of their tag-team illusions for a solo act, complete with absurd non-sequitur patter and a failed “switcheroo” when there’s no one with whom to switch. The biggest kick comes when Jim Carrey shows up as Steve Gray, a Criss Angel-esque extreme illusionist whose cutting-edge image threatens Burt’s old-school ways. His stunts include holding in his pee until a doctor warns “he now has more urine than blood,” and breaking the staring record while getting doused with pepper spray. We want a chance to see that ultimate showdown of self-absorbed showmanship, because the silliness is the center of this story.

Until, that is, the story goes somewhere else. When Burt loses his casino gig and hits rock bottom, The Incredible Burt Wonderstone actually starts to shift into a redemption story. Working as a last resort in an assisted-living facility where he meets a cynical, now-retired Rance Holloway, Burt tries to rediscover his love of magic, as well as make himself worthy of the affections of the assistant, Jane (Olivia Wilde), whose name he never bothered to get right. In bits and flashes, we see Carell the seriocomic actor who has been so good in movies like Dan in Real Life and Seeking a Friend for the End of the World, but the screenplay hasn’t given his character the foundation for anything beyond wacky situations. When Burt and Steve Gray do get their magical face-off, Carrey is still acting in a broad satire, but Carell is trying to be sincere about how far Burt has fallen.

The Incredible Burt Wonderstone closes with a hilarious bit in which we get a step-by-step look at how Burt and Anton pull off their amazing new “disappearing audience” illusion. It’s a terrific collection of purely visual gags by director Don Scardino (a veteran of episodic television including 30 Rock) that yanks the movie back into the raucous comedy promised by the earlier tone. That feels like the version of Burt Wonderstone this always should have been, without the half-hearted attempt at giving him real heart and soul beneath his bluster and bravado. The filmmakers here toss us scraps to convince us that beneath the spray-tan of the jaded Burt Wonderstone is the wounded, lonely Burt Weinzelstein, and in so doing miss the opportunity simply to make us laugh harder and more often. It’s always better when we’re laughing at Burt Wonderstone than when we’re expected to laugh — and feel — with him.