“He” was Warren Beatty, who, along with Faye Dunaway, presented the final award of the night. Mr. Beatty opened the envelope and, after some hesitation, handed it to Ms. Dunaway. She said that “La La Land,” about young California dreamers, was the winner. The crowd erupted in applause, and the “La La Land” team rushed the stage.

Why did it take minutes to fix the error? “PwC sounded the alarm, but not right away,” Gary Natoli, the telecast’s stage manager, said in a text message. “It wasn’t until just before I jumped onstage that it was confirmed by both Brian and Martha as the winner being incorrect.” Martha L. Ruiz, a PwC colleague of Mr. Cullinan’s who stood on the opposite side of the stage, and Mr. Cullinan apparently needed to find each other backstage to confer before speaking up.

It was one of the most surprising reversals in Oscar history, as human error combined with live television to powerful, jaw-dropping effect. It also warped and dampened the euphoria of film executives and artists who had spent years working on the two movies. And for the academy, which had been criticized last year for failing to nominate any minority actors for the second consecutive year, there was a missed moment: Instead of a proper celebration of “Moonlight,” there was a televised scene of confusion, disbelief and astonishment.

Backstage, Michael De Luca and Jennifer Todd, the telecast’s producers, were sitting at their monitors, Diet Cokes in hand. They were under the impression that the show was a wrap. But the scene quickly became chaotic, as it emerged that the winner was, in fact, “Moonlight,” a tender drama about a young, black man coming to terms with his homosexuality.

“I’m holding the envelope and the award, and I had just given my speech, and there are people on the stage with headsets and I thought, ‘That doesn’t seem right,’” Jordan Horowitz, a “La La Land” producer, recalled.