Science is a self correcting mechanism if done right, it is self checking and it is supposed to maintain the position that you never know everything, that there is always a question. Science is supposed to work on the basis that even things presumed to be true are not sacrosanct, and when science finally proved out plate tectonics (interestingly, this only happened in the late 60’s), it became settled theory but it is still being investigated and refined.
The problem with science is like anything else in humanity, it is human and can be corrupted, can be about power and maintaining the status quo. In physics in the late 19th century, there was a large body of physicists who decided Newton and Maxwell had done it all, and those who created the revolution did so outside the mainstream, they had to. Wiggener, the man who came up with plate tectonics, was considered a kook by the mainstream geo science community. Fred Hoyle held onto continuous creation for years, and the battles over that versus the big bang were often less than collegial. Ego and money can corrupt things, and often you get a block of ‘power brokers’ in science, who at one time made some great discoveries, who blocked real change. Then, too, politics plays a role, a lot of what you see with supposed diet science is often based in the political and economic side of things, like the government dietary standards, or the medical community now that genetics has been found to be the big issue with heart disease pushing statin drugs (that gee, just happen to be incredibly lucrative). The only good thing is that for example as with the myth that dietary cholesterol had anything to do with heart disease, people kept refining studies and finally put the final nail in the coffin of that myth.
And I will add that in many things, despite the claims of the luddite and the bible thumpers, science more and more is an evolutionary process, you just don’t see that many things get set on their ears, the way the big bang did continuous creation in cosmology. Even Einstein and the work of quantum physics did not throw away Newton and Maxwell, it simply explained things they couldn’t and for example, despite the claim of ‘creationists’, evolution has continued to solve the gaps in knowledge and refined understanding. That understanding has changed, like for example realizing human evolution and immigration happened in many waves, but the fundamental concepts continue to improve, not be thrown out. In physics and chemistry, things once mysteries have been unlocked, and more understanding comes with that. When critics point to ‘new ice age’ theory in the 70’s, as proof that science ‘makes mistakes’, what that leaves out is few accepted that idea, and within a couple of years of that idea hitting Time Magazine, it was dead. As opposed to that, the idea of global climate change over time has gotten more and more people on board, and even some hardened skeptics have come around and accepted the premise, without necessarily agreeing with rates of change or what can be done, and very, very few scientists, and certainly not the ‘thousands and thousands’ claimed by deniers, have changed from believing climate change is upon us and man made into saying it doesn’t exist or it is natural. The fallacy is in believing science can cure everything, science has a pretty damn good track record, in the 20th century we went from living on average in our 40’s to living in our 70’s, for example, but most of our problems tend to be more about human frailty and foolishness, something science can’t really cure.