For most of us, being back in high school and having to graduate all over again is just an anxiety dream. But for the quietly audacious Scotsman at the center of My Old School, re-doing high school was the game plan. Jono McLeod’s devilishly entertaining documentary tells the story of “Brandon Lee,” a well-liked transfer student at Bearsden Academy near Glasgow, who, starting in 1993, breezed through two years of classes and even starred in a school production of South Pacific. But 16-year-old “Brandon” was in fact Brian MacKinnon, a 30-year-old man who—you can’t fault the man’s nerve—had previously graduated from the very same school.

A scene from My Old School.

Classmates of Brandon’s recall hanging out with an odd but friendly guy who claimed to be from Canada, seemed to know all the answers in class, and liked cool bands from the early 80s. “I think what’s interesting about the film is that it forces you to reconsider the vagaries of memory,” said Alan Cumming, who appears in costume as MacKinnon in the film, lip-synching to audio interviews conducted by McLeod, who, by the way, was also a classmate during MacKinnon’s second stint. (MacKinnon, now aged 59 and last reported to be unemployed and living in Glasgow, talked to McLeod but declined to go on camera.)

Cumming deftly channels MacKinnon’s manner, understated but simmering with something strange. But how did classmates not catch on? “Many of them say, ‘Oh, he looked old,’ and they called him ‘Thirtysomething’ and all that, but he wasn’t found out,” Cumming told me a couple of weeks ago. He chalks up the collective cluelessness to the hormonal roulette of adolescent looks. “I don’t think I would have realized.” (There are conflicting explanations as to how word of MacKinnon’s deception got out.)

Brian MacKinnon, then 32, poses as a schoolboy, 1995.

As for why MacKinnon was hell-bent on a diploma do-over, the reason feels almost like an afterthought to the rise and fall of his risky gambit, which McLeod illustrates with animations that resemble over-it 90s cartoon Daria and feature the voice of Scottish “To Sir with Love” singer Lulu. (As it turns out, MacKinnon was just trying to get into medical school—for the second time, after his earlier attempt was cut short by illness and failed exams.)

Not that anything could truly explain the profoundly ridiculous ruse. But the ever youthful Cumming doesn’t find all of it outlandish. “I often get that people think I’m much younger than I actually am,” he said, and I think I can hear him smile. “So it can happen.”

My Old School hits theaters on July 22

Nicolas Rapold is a New York–based writer and the former editor of Film Comment magazine