So that happened.

After “La La Land” more or less marched through award season and seemed to march through the Oscars as well, the producing staff swooped in to announce that, somehow, presenter Warren Beatty received the wrong envelope and announced “La La Land” had won best picture.

In fact, “Moonlight,” Barry Jenkins’ coming-of-age film about a gay black boy in the Miami projects won the top prize. But due to some level of general incompetence, that did not become clear until halfway through “La La Land” team’s acceptance speeches.

Twitter was quick to jump on the unprecedented event, comparing it to everything from Steve Harvey to “La La Land” itself, with one particularly observant user saying “In true form, La La Land only won Best Picture in a fantasy moment shared between former lovers imagining wistfully what might have been.”

Despite what was an agonizing loss for “La La Land,” it was something of a blessing for the telecast, which had been mostly by the numbers and dull.

The Oscar’s host Jimmy Kimmel, the less interesting of the late-night Jimmy’s, was definitely not James Franco/Anne Hathaway atrocious, but was nowhere near the Billy Crystal peak of excellence. His long-running tour bus bit was meandering and pointless, and Kimmel’s incessant banging of the Matt Damon-abuse drum grew tiresome.

Big Bads: ‘The Wiz’ adaptation tarnishes Broadway classicFirst staged on Broadway in 1975, “The Wiz,” an all-black re-imagining of “The Wizard of Oz,” was a bonafide hit. Read…

There were other highlights before the best picture fiasco, which will surely dominate future conversation of this ceremony. Auli’i Cravalho and Lin-Manuel Miranda had the most compelling musical performance of the night with their live rendition of “How Far I’ll Go” from “Moana.”

Mercifully, the frog-throated Ryan Gosling did not perform on stage at the Dolby Theatre, and John Legend turned in a solid rendition of “City of Stars,” which went on to win best original song.

It was an excellent night for black performers, as Mahershala Ali and Viola Davis took home best supporting actor and actress, respectively. After two years of #OscarsSoWhite, it was refreshing to see Ali and Davis justly rewarded for their excellent work.

But circling back to the inadvertent centerpiece of the evening, the victory for “Moonlight” was unprecedented in other ways, beyond the Steve Harvey-esque mishap. It is the first film with an LGBTQ+ protagonist to win best picture, mercifully usurping “La La Land,” the anthem to mediocre white people.

The writing was on the wall after “La La Land” was upset at the Screen Actors Guild Awards, when “Hidden Figures” won out for best cast. But “Moonlight” taking the prize was still a shocking upset.

After Damien Chazelle took best director, which was considered to be much less of a sure thing, it seemed his musical would waltz off of the stage with the best picture statuette as well. Thankfully, quality and important cinema won out Sunday night, and there was, fittingly, no happy ending for “La La Land.”