Richard Curtis writes romantic comedies – Four Weddings and a Funeral and Love Actually are the best – so enticing that we wish they were real. His films are believable enough emotionally to be both joyful and heartbreaking, while their characters and situations are more colourful and exciting than everyday life. And they flow with the effortless charm of, say, early Hugh Grant.

Yesterday has those qualities, except this time the true love affair is between filmgoers and The Beatles, whose music forms a nearly wall-to-wall soundtrack. The fanciful, hilarious premise is that an unsuccessful Suffolk busker named Jack Malick wakes up one day as the only man on Earth who remembers the group. The Lennon-McCartney catalogue is suddenly all his.    

Jack’s original songs and his voice, which we hear at the start of the film, are perfectly fine but not the stuff of stardom. Himesh Patel, who may be familiar to UK audiences from EastEnders and who is unknown in the US, makes Jack just talented enough so that Ellie (Lily James), an old friend and now a schoolteacher, acts as his manager. Neither one acknowledges their mutual attraction, but the film makes it plain to us.

When a power blackout briefly darkens the entire world, Jack is hit by a car and comes to in a hospital bed. Days later, missing his front teeth and especially unromantic-looking, he sings Yesterday and Ellie is brought to tears by the exquisitely beautiful song she assumes he wrote. The comedy, full of pop-culture references, kicks in when Jack tries to sort out the confusion. Googling The Beatles brings up only images of bugs, so he pretends their music is his and walks around trying to recall the words to Eleanor Rigby. That’s a legitimate problem in his case. Quick: who’s darning socks and what’s in the jar by the door?

Danny Boyle’s apparently simple style actually relies on a complicated balance of sweetness, naturalness, and big, bright settings

When Jack sings The Long and Winding Road or Let It Be solo, the effect is to remind us of just how lovely those melodies are. And the comedy passes a crucial test. Even though the trailer gives away some jokes, they are still funny when they pop up on screen. Meera Syal, as Jack’s mum, has perfect comic timing when she confidently tells a neighbour that Jack’s new song is called Leave It Be. All the supporting actors are just as deft and natural, including Sanjeev Bhaskar as Jack’s dad, and Joel Fry as his bumbling but loyal friend turned roadie. Ed Sheeran gamely plays a version of himself. He asks Jack to open for him on tour, which takes them to Russia, where Jack supposedly writes another Beatles song on the spot, and Sheeran realises he can’t compete with his protégé.

Danny Boyle, the director of Trainspotting and 28 Days Later, is not the first person who comes to mind for a Richard Curtis film. But he turns out to be a perfect fit, with a light touch. As in Slumdog Millionaire, Boyle’s apparently simple style actually relies on a complicated balance of sweetness, naturalness, and big, bright settings, including a rooftop concert by the sea where Jack sings Help! and a Sheeran concert at Wembley Stadium. As the blackout rolls out across the world, it’s an echo of how gracefully Boyle handled the opening ceremony at the London Olympics. But he never allows the locations to overwhelm the dilemma of an ordinary guy caught in an outlandish situation. When Jack gets a recording contract, which takes him to Los Angeles, Curtis is wry about the executives and advisors trying to market their new genius. Sheeran helpfully suggests that “Hey, Dude” is an improvement on Jack’s original lyric. Who’s Jude, anyway? Throughout, the film subtly makes the point that genius has nothing to do with logic.

Surprisingly for a Curtis film, the weakest part here is the romantic plot between Ellie and Jack, whose feelings and missed connections should have felt more urgent. James makes Ellie sincere and likeable, but did she have to be given clothes and hair so frumpy that she looks like a walking cliché of a schoolteacher? She does pull off a moment that echoes Notting Hill (in reverse), where one person in the romantic couple is famous and the other is not. While realising it might be too late, Ellie tells Jack, “I’ve been waiting half my life for you to wake up and love me. But I am a schoolteacher and you are the world’s greatest singer-songwriter.”

Even though the romance is a bit flat, the Beatles part of Yesterday is more than enough to carry it. A couple of times the film teases the possibility that the real Paul or Ringo might turn up to call Jack out on his fraud. But the most stunning moment is an out-of-nowhere shock, a jaw-dropping visual trick.

Curtis often divides opinion. Every Christmas, Twitter explodes with a debate about Love Actually, split between people who adore and it and others who think it’s a blight on civilisation. But Curtis has always embraced the sentimentality underlying his stories, and earns that right – as do the scenes of all the loving reunions at the airport that book-end Love Actually – by creating screenplays that glitter with wit. If you’re among those viewers who find his films too sugary, all I can add about Yesterday is: you’re on your own.  

★★★★☆ 

Love film? Join BBC Culture Film Club on Facebook, a community for film fanatics all over the world.

If you would like to comment on this story or anything else you have seen on BBC Culture, head over to our Facebook page or message us on Twitter.

And if you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Culture, Capital and Travel, delivered to your inbox every Friday.