This scene in the books and movies was pretty powerful. It was a real depiction of one of Hermione’s biggest flaws - hubris.
She’s incredibly smart and hardworking, and she knows it. She’s used to having it pay off. So when it doesn’t, she’s really destabilized and almost vulnerable. Being the smartest witch in school is her thing - that’s her corner. I imagine that at times, when she felt unpretty or unpopular, like we all do, when she doubted herself or was mocked and belittled for being the daughter of two dentists, she always had that comfort to fall back on. That no matter what they said, they’d never take away from her the fact that she was simply unparalleled in class.
And in this scene, her faith is shaken. For once, her hard work is rewarded by frustration and failure, which is incredibly disappointing considering she probably wanted to demonstrate her prowess for a potion masters that might have something other than disdain for her, since Snape finally wasn’t their professor anymore. She’s not accustomed to that feeling, and I’m sure she probably doesn’t know how to handle it very well. And she face plants (like everyone else) while Harry more or less cheats (in her opinion), and doesn’t that gall? It’s a petty emotion, but we all experience them.
Hermione is such an amazing character, and sometimes it’s important to see those cracks in the wall and see people for who they really are: smart, talented, loving and dedicated - but also insecure, churlish and a bit petty.
This is one scene in the movies where I think super!Hermione fell away completely and they got Hermione perfectly right. Spot-on analysis.