The actor was presenting an award to director Luca Guadagnino, with whom she has worked on films including A Bigger Splash and Suspiria.
Johnson made the quip while discussing the filmmaker’s Call Me By Your Name, in which Hammer starred alongside Timothée Chalamet.
“It was here at Sundance in 2017 that audiences experienced a film that is uniquely characterised by Luca’s iconic approach to storytelling,” the Fifty Shades of Grey star said in a clip from the event that has been widely shared on Twitter.
“The vision and the style of it is Call Me By Your Name – sadly, I wasn’t in that one,” she continued, stating: “It was unfortunate.”
Referring to a memorable scene from the film, in which Hammer eats a peach that Chalamet’s character has performed a sexual act on, Johnson said: “Luca had asked me to play the role of the peach, but our schedules conflicted.
“Thank God, because then I would have been another woman that Armie Hammer tried to eat.”
Johnson was making a reference to a social media scandal in which messages, allegedly sent by Hammer, were circulated online.
The messages, which have not been verified, appeared to contain graphic sexual fantasies and mentioned cannibalism.
Following the scandal, Hammer lost his talent representation, and was dropped from several high-profile films, including a series based on the making of The Godfather, titled The Offer, and a Jennifer Lopez romcom titled Shotgun Wedding. He was replaced by Miles Teller and Josh Duhamel, respectively.
Johnson was presenting Guadagnino with the Sundance Institute International Icon Award at an event, which took place at the Basin Recreation Fieldhouse in Utah.
In the clip, gasps can be heard from the audience, but some people in the crowd cheer and applaud the actor’s joke.
Sundance Film Festival kicked off its first in-person run in two years on Thursday (19 January).
Joana Vicente, Sundance Institute CEO Joana Vicente, said of the return: “It feels so good to be back in person. There’s nothing like the magic of being together in Park City.”