Trial and error with prescription drugs without a diagnosis as you suggest is malpractice. Maybe you're specifically referring to psychiatry? That specialty is uniquely difficult since our understanding of psychiatric diseases is still murky. But even within psychiatry there are best practice guidelines on how to manage and treat different diseases.
It's like Googling coding questions and reading a StackOverflow thread. Obviously no programmer is solely relying on StackOverflow to do their job as no physician is solely relying on Google, UpToDate, or any other resource. They're simply quick references.
I've encountered a few people who were doing something very close to this. I really hope that doesn't happen in medicine too.
I think this is especially visible in software "engineering" with people joining the craft after a few weeks of boot camp. (think engineering vs programming)
However, we put doctors through an especially rigorous and long training and certification process to minimize the amount of unqualified practitioners.
Having been for 18 months through different types of psychiatrists and clinics, I came out quite surprised in how "trial and error" this whole system is.
I'm writing this from Switzerland, where we have an (arguably) high quality health care system. But the amount of "OK, that didn't work, lets try this other drug". Or, now, 18 months later, "Oh well, we did the list once through. But who tells me that the MD prescribing the first drug did a correct analysis? Lets start the list from top again." Or, for a friend of mine, his girlfriend found a working cure like that: "Oh, this brochure describes your symptoms so clearly, and it's completely different from what you've been treated for these last 20 years. Let's try it!"
Spoiler alert for my case with the list: the top of the list was not better the second time around.
If you think this is cynical, well, I would like at least _one_ of these drugs to work. If you think the MDs are all useless: well, at some times I was glad they were there.
So, well, I think having a little less than random system might be helping. Let the MDs watch if it makes sense, enter the correct diagnosis, and catch the stupid errors data entry people can make. But i'd give it a try...
https://www.washingtonpost.com/nation/2020/01/28/opioid-kick...