On the one hand a doctor spend years to study medicine and with each year spent in the profession he acquires more and more experience in recognizing and dealing with various illnesses and injuries and potentially follow all kinds of medical studies and even look into more traditional (or non-traditional) healing practices and folk remedies. So a doctor can have way more information on the human body and the human health.
If you go to the doc, they can examine you and listen to you, but with examination they only get so much info, and you can feed literal bs about your condition tell absolutely unrelated symptoms (as most patients do - "Oh, Mr Doctor I have no idea how that rash got onto my penis I have never had unprotected sex with prostitutes"), and they have to put a diagnosis together from this mess.
And then doctors are human beans. They have their own life and problems, they are often overworked and over 9000 things can influence their performance in their job, from their kids failing at school to new shoes that tight at the heel. They can dismiss symptoms based on personal experience, and their specialization can skew their view about what you have, and they tend to use the tools they have. A surgeon will see problems he can operate.
And then comes the money. Big Pharma wants to be profitable and will push drugs onto doctors and even governments. Lobby is strong. And then in some countries doctors can work in public health institutions and can have a private clinic. The second will make him more money, so why bother with good service in the day job. Not to mention when in the government itself people has ownership in private clinics and they drive the public healthcare as a whole down into the ground.
We don't live in an ideal world.