I am a pharmacist. If you ever have a question about a prescription being correct, PLEASE call and ask to speak to a pharmacist. The tech should never handle any issues about a misfilled prescription. And by law, the pharmacist checks every prescription and is the one responsible for the error.
I am so sorry that the cashier didn't look into the problem when your husband questioned 2 prescriptions. It would have saved you a lot of stress. I can tell you exactly how the error happen though. Most likely, your daughter's amoxicillin prescription was entered into the computer right before the other patients Xanax prescription. The tech entering the info in the computer forgot to enter the new patients name on the Xanax prescription and your daughther's name ended up on the Rx. Should this have been caught by the Pharmacist? Yes! That is one reason we always ask for patient's birthdates when you bring in a prescription. Even if the pharmacist overlooks the name when checking, they have a birthdate to doublecheck.
I know it sounds like no big deal to be sure the correct name is on a prescription, but when one pharmacist checks 200 to 300 prescriptions over a 12 hour day, mistakes do happen. It's no excuse, every prescription should be correct, everytime. But we are human, we do get tired, we do have life stress from home affecting our day at work, just like everyone else.
When you do take the bottle back, be sure you speak to the pharmacist. They should give you a phone number and report number from them reporting the incident to their headquarters. Be sure they give you one. As long as these things are reported, the company will be sure one pharmacist is not making too many mistakes. And yes, some pharmacists are fired for making errors.
Again, I'm sorry you are having to deal with this when your husband questioned it at the register. Not what you need when you have a sick little one at home!