Ha, I've done that when I worked cashier at my side hustle.
Called a dude ma'am and called a chick sir, I don't know which one is worse. It usually happened towards the end of a shift when I was exhausted and not making good eye contact with the customer.
It also stemmed from my many years of military service where a) you addressed someone with sir or ma'am and b) if it had short hair, it was a sir, if it had long hair it was a ma'am.