There are a couple things going on here.
First, if she's smart and she's new and there aren't any added benefits for working the register, she might have done it on purpose in order to get assigned to work a different section of the store. I've seen it happen. Working the register is NOT fun and if there's no added benefit, plenty of smart employees will try to get out of it. It's just extra work, annoying people, dirty money, and added responsibility. YUCK!
Second, when you're an employee there's a class thing that goes on between you and the customer. You are NOT equals. The customer acts like they're higher class than you, whether they intend to do that or not. It's part of our consumerist culture and it's codified in the statement "The customer is always right." Sometimes that whole power dynamic can fluster otherwise smart people and make them get their math wrong.
Or sometimes it's the same as a stage-fright. Most people are uncomfortable giving public speeches. That situation where the customer is saying the cashier made a mistake can feel like being put on the spot. She might simply have reacted negatively because she was nervous.
But it's very likely she's just not very good at math, in which case it's really the manager who made the mistake of hiring her and assigning her that job.