https://en.wikipedia.org/wiki/Ignaz_SemmelweisSemmelweis proposed the practice of washing hands with chlorinated lime solutions in 1847 while working in Vienna General Hospital's First Obstetrical Clinic, where doctors' wards had three times the mortality of midwives' wards.[5] He published a book of his findings in Etiology, Concept and Prophylaxis of Childbed Fever.
Despite various publications of results where hand washing reduced mortality to below 1%, Semmelweis's observations conflicted with the established scientific and medical opinions of the time and his ideas were rejected by the medical community. Semmelweis could offer no acceptable scientific explanation for his findings, and some doctors were offended at the suggestion that they should wash their hands. Semmelweis's practice earned widespread acceptance only years after his death, when Louis Pasteur confirmed the germ theory and Joseph Lister, acting on the French microbiologist's research, practiced and operated, using hygienic methods, with great success. In 1865, Semmelweis was committed to an asylum, where he died at age 47 of pyaemia, after being beaten by the guards, only 14 days after he was committed.
Galileo also comes to mind:
https://en.wikipedia.org/wiki/Galileo_affair
I am sure there are many others, those are just ones I readily remember off the top of my head. Current "experts" are really terrible about defending their current belief system, and actual evidence be damned. Their jobs and whatever depend on them being right, so don't confuse them with the facts LA LA LA NOT LISTENING. (And because they are experts, many other people simply defer to them.)
This does not appear to have changed in the modern world.