I worked at a pharmacy in the US for 8 years. This is simply not quite true, and your telling of it paints a picture that is different from reality.
Doctors have to specify when writing a prescription if an generic is acceptable or not. It is always a deliberate choice with each and every prescription. There is no "Just forgetting." Paper prescriptions, for example, have two different places for signatures. Most doctors know that insurances often require generics.
There are good reasons not to substitute for some medications: Lithium (common for bipolar disorder), for example, sometimes absorbs differently between brands. Even with drugs that have no generics, most doctors will write a prescription saying that a generic is acceptable in case one has been approved without their knowledge. Doctors really only need to know when there are differences with generics vs brand names.
Not only that, but if the doctor requests the brand name, most pharmacies will call the doctor to see if they can switch to a lower-cost generic if the patient requests it. This is done a lot, sometimes simply because the patient doesn't realize the medicacation costs when they are at the doctor's office - they often don't realize the costs until the pharmacy runs the prescription through their insurance.
The same is true if the doctor prescribes something not covered by a patient's drug formulary: some insurances require folks start off with x or y drug and only give special acceptance to drug z if they've tried the other drug.