I worked on an investigative news piece on this while interning at a news station in college. The *reported* error rate for pharmacies is 1-2% of prescriptions are filled incorrectly. That's just the mistakes that actually get reported, so it's probably a little higher. That means that for a busy pharmacy that fills 100-200 prescriptions a day, 1-4 of them are wrong. Sometimes it's the wrong dose (that was the most common error), sometimes it's the wrong form of a medicine (liquid vs. pill vs. topical), and sometimes it's the completely wrong medication. Luckily, most mix ups are fairly harmless. The story that prompted our report was of a woman whose infant was prescribed an antibiotic at many times the correct dosage (it was supposed to be something like 1/2 tsp 2x a day and was printed as 2 tsp 2x a day) - the baby was fine, just quite sick to her stomach.
Doctors can make the same errors, they're only human. I think your story is a great reminder that there are several points of possible failure in the chain - it starts with the doctor, then goes to the pharmacy, then the patient or parent. All it takes is for one of those 3 people to be double-checking to prevent and error. Of course we want things to be error-free, and electronic prescriptions have helped out a lot, but none of us is perfect every minute of every day. That's why at the patient or parent, the responsibility is on us to ask for write down the name of what the doctor prescribes, what it looks like and the dose. Then when you get the medicine, check everything (name, dose, that the description on the container matches the contents) before giving or taking it. We're only looking at one new prescription at a time while the doctors and pharmacies are processing dozens a day.
I really only know to do this from what I learned on that news story. I did get a medication for one of my kids once that was not what I expected - the pills were different name, color and dose. I called the pharmacy and then the pediatrician's office. It turned out that my insurance company didn't cover the first medication, so the doctor substituted something else so the prescription was correct. The nurse who took my call though did remark that they do this regularly and I was the first parent to ever call in and verify that the switch was intentional.
Good thing that you had the sense to check! I wouldn't really do anything about it - it was a mistake, I'm sure he feels bad, but they happen. Just use this to validate your own vigilance and make sure that you continue to be diligent about check each prescription carefully!