Antibiotics are an obvious one. Antibiotic resistance is a real, and growing, issue. If people start popping them every time they get a sniffle, that's going to get a lot worse.
Some medications have very serious side effects, and a doctor really should vet that you're healthy enough to withstand those.
Some medications can have very severe interactions. Part of the prescription process is that their computer is supposed to alert the pharmacist if some combination of the meds you're on creates an issue.
Honestly, those few categories knock out most of the useful medications. Mental health drugs are generally safe, but self-medication isn't usually effective in those scenarios.
So pharmaceutical companies and other medical product manufacturers manage their risk by only selling to approved suppliers, so that they don't have people randomly putting themselves at risk using their products.
Medical products have risk assessments a mile long for every scenario the manufacture can think of, and the mitigation for being administered on the wrong patient is often "Don't sell to non ISO-13485 approved clients"
If enough people get injured because of your product, the FDA or MHRA is going to investigate you, no matter how many disclaimers you put on your products.