Zoey Deutch and Miles Gutierrez-Riley in Gail Daughtry and the Celebrity Sex Pass (Sony Pictures Classics)

No matter what the movies teach us, not every dream comes true, and not every road leads back home. But if you’re Gail Daughtry (Zoey Deutch), a hairstylist from rural Kansas, just two weeks away from marrying your high school sweetheart, it means you carry your heart on your sleeve, you think everything you dream is achievable, and—you’ve probably heard this before—there’s no place like home. Well, she may seem old enough not to be quite so naïve, but you can’t blame her when her life is perfect and her modest, small-town ambitions (where everybody loves her) have been rewarded every step of the way. Still, the movies have taught us something else: Adventure has a way of arriving when you least expect it, and a tornado can change everything.

Gail Daughtry and the Celebrity Sex Pass is a one-of-a-kind comedy that takes its time getting to know its heroine and the too-good-to-be-true world that she inhabits, gradually steering us toward its central conflict without ever compromising her innocence. In this sweet, off-kilter movie, directed by David Wain, anything goes (for starters, a friendly mailman narrates directly to the camera). Yet just how wild—and occasionally bizarre—it will get isn’t immediately apparent as Gail hangs out with her best friend, Otto (Miles Gutierrez-Riley), who asks her to travel with him to a Los Angeles hairstylist convention. She can’t go because the wedding is approaching. Nor can you predict just how strange things will become when she and her fiancé, Tom (Michael Cassidy), suddenly start discussing who their respective celebrity sex passes would be.

Gail sheepishly admits that her choice is Jon Hamm—anyone who’s watched every season of Mad Men like she has can’t blame her. Tom picks Tilda Swinton, but after meeting Jennifer Aniston at a signing for the self-help book she’s promoting on tour, he decides it’s only fair to change his original choice. The charming Friends star spends such a long time writing something in their copy that the couple imagines she’s composing a heartfelt, personal dedication (it’s just “XO”).

Well, if Gail thought her life was already perfectly settled, here comes the tornado: Jennifer Aniston sleeps with Tom. (The actress is clearly having a blast playing a slightly twisted version of herself.) When Gail catches them in the act, Tom believes nothing wrong has happened—those are the rules of having a celebrity sex pass, after all. For Gail, however, things aren’t so simple, and she feels as though her world has collapsed. So, there’s nothing better to clear the mind than a journey with Otto to Tinseltown, where she might decide what to do next.

A chance encounter with a pair of cartoonishly stereotypical Italian Americans who may—or may not—be henchmen (they are!) leads to an accidental suitcase swap that will later prove problematic. At a psychic reading, Psychic Journeys LLC co-owner Charlotte Manetti (Kerri Kenney-Silver) advises Gail, after reading her tarot cards, that the only way to resolve her conflicted feelings about Tom is to restore the balance by sleeping with her own celebrity sex pass: yes, Jon Hamm.

But how do you even begin? Along the way, Gail and Otto befriend the not-particularly-bright Caleb (Ben Wang), an aspiring young agent who’s just been fired from CAA; Vincent (Ken Marino), a former paparazzo trying to reclaim his heartless reputation; and John Slattery (playing himself), now a washed-up celebrity. (If you’ve looked at Slattery’s filmography, you’ll know he’s always fully booked both in film and television, so let’s just suspend our disbelief here.) Together, they’re all off to see Jon Hamm—and Jon Hamm may end up giving each of them exactly what they need to change their lives.

Sooner or later, it may suddenly click where you’ve seen all of this before. If Gail Daughtry’s name didn’t already remind you a little too much of Dorothy Gale, and if Zoey Deutch’s pitch-perfect performance—preserving Dorothy’s irrepressible innocence—didn’t give it away, the remaining clues certainly will. Yes, this is The Wizard of Oz, only with transactional sex, gangsters, Hollywood misfits, countless pop culture references, surprise celebrity cameos, and a cynical portrait of show business and the City of Dreams. Oh yes, there’s also a witch in the form of Ludovica (Sabrina Impacciatore), a mob matriarch who desperately needs the suitcase Gail has unknowingly carried with her the entire time. This villain subplot is the weakest part of the comedy, creating room for a handful of nonsensical bursts of violence that occasionally clash with everything else the movie is doing.

Despite all of these ingredients—and all the direct and indirect echoes of one of Hollywood’s most enduring myths and storytelling blueprints (the Judy Garland-starring film far more than L. Frank Baum’s novel)—Gail Daughtry and the Celebrity Sex Pass never suffers from its familiarity with the classic. Instead, it delivers an adult comedy full of whimsy and laughs, one that feels destined to become a comfort movie for an audience willing to embrace a delightfully subversive fairy tale that never mistakes itself for something serious. And yes, you’ll get Hamm in due time—and considerably more than the wonderfully cheeky title promises.