Harry Potter director Chris Columbus said he couldn’t cast Robin Williams in his film because it would break the franchise’s rule against casting American actors.

Robin Williams - Harry Potter

PHOTO: ROBIN MARCHANT/GETTY; WARNER BROTHERS/COURTESY EVERETT COLLECTION

David Thewlis brought Harry Potter’s beloved Remus Lupin to life, but another famous actor was vying for the role before he nabbed the part.

Chris Columbus, who directed Harry Potter and the Philosopher’s Stone, the very first film in the fantasy franchise, celebrated the movie’s 20-year anniversary with an interview with Total Film, per GamesRadar.

During his conversation with the magazine, Columbus revealed that Robin Williams expressed interest in playing Lupin, a werewolf who is first introduced in Harry Potter and the Prisoner of Azkaban, the third book and film in the franchise.

Robin Williams

Robin Williams. ETHAN MILLER/GETTY IMAGES

Columbus explained that Williams lost out on the role because casting him would have broken a rule to avoid casting any American actors in an effort to “maintain a degree of authenticity,” per Total Film.

“I had a conversation with Robin Williams, who wanted to play Lupin,” Columbus, who is American, recalled. “It was very difficult for me to say, ‘It’s all British. There’s nothing I can do.’ “

Columbus directed both the first and second Harry Potter films, while Alfonso Cuarón stepped in for the third, which featured Thewlis’ first appearance as Lupin in 2004. The actor went on to play the role up until his final appearance in 2011.

Casting director Janet Hirshenson mentioned the British actors rule in a 2016 interview with HuffPost, telling the outlet a similar story about Williams’ hopes to join the franchise. She said he had been turned down for the role of Hagrid, which later went to Robbie Coltrane.

“Robin [Williams] had called [Chris Columbus] because he really wanted to be in the movie, but it was a British-only edict, and once he said no to Robin, he wasn’t going to say yes to anybody else, that’s for sure,” she said at the time. “It couldn’t be.”

Williams, who died in August 2014, briefly mentioned the Harry Potter casting rule in a 2001 interview with The New York Post.

“There were a couple of parts I would have wanted to play, but there was a ban on [using] American actors,” he said, before adding, “Maybe one day. Say if [Harry] goes to Yale and becomes president.”