I got invited to some sort of literary award ceremony at the French embassy a few years back. I, uh, severely underdressed for the occasion. I got the invite for participating in the Albertine book store's bookclub, and for whatever reason, my brain went, "I can show up to this like I would dress for a bookclub session, it's the same people." Spoiler, it was not, and I really should have been at least in a button up and slacks, rather than my hoodie and jeans. As luck would have it, the gentleman who won the award, Emmanuel Dongala, was sat next to me during the speeches. I can still remember the look of "What the classless, American fuck is this guy doing?" as he took his seat next to me.
On the other hand, I went to my first opera at the NY Metropolitan Opera last year basically dressed the same way, and it was surprisingly entirely fine. Turns out, very few people want to be sat for hours in formal attire when hardly anyone can see you in the dark, anyway.