Natural selection describes the process by which variations in a population of organisms are edited over time to enhance the ability of the individual organisms to survive and reproduce in an environment. Even if over 90% of all mutations, being random, are harmful to the next generation, natural selection can still eliminate those and keep those others that are beneficial, thus countering the destructive effects of mutations in general.
It is the same with the scientific peer review process. Because science has made so much progress over the past few centuries, most people have the impression that scientists are unusually brilliant, nearly infallible, and totally objective in their views and methods. But in fact, that is simply not the case for most of them, at least as individuals. Scientists can be just as mistaken, corrupt, dogmatic, and failing in their efforts and assumptions as the rest of humanity. A few of them can even be downright stupid!
If that is true, how can science be trusted to produce reliable facts and theories? Because the scientists use peer review as their means to test any new ideas put on the table by one of their number. No scientist’s word need be taken at face value. In order for his idea to be accepted as anything beyond a speculation, he must show observational or experimental data, clearly defined, that supports it. Thus, it should always be possible for other scientists to duplicate the results of the first scientist making the claim. If attempts to duplicate the observations or experiments do not produce the same result, the idea is rejected.
Sometimes the peer review process goes too far in its skepticism, and a valid idea, such as continental drift, is rejected and even ridiculed by scientists even though it explains all the data collected and is contradicted by none of it. But that’s why repeated testing of that idea is required, as long as it is not outright falsified. Continental drift WAS accepted in the 1960s once an overwhelming amount of evidence was found to support it and those geologists who had been bigoted against it in the 1920s had died or retired, and a new generation had arisen that was more open-minded. Those who supported the continental drift theory were able to come up with a mechanism, plate tectonics, that explained it, and once they did opposition to it faded away rapidly.
Individual scientists may fall so deeply in love with their own ideas that they refuse to accept the peer review process when it rejects their ideas. Then they become cranks who no longer do science, but instead put out propaganda to appeal to the scientifically illiterate. This is especially true of Creationists and global warming denialists who happen to have science degrees. They even go so far as to attack the peer review process itself! But it must be noted that they can never produce anything that would produce superior results in terms of seeking objective data in the universe and explaining it.
Scientists who refuse to recognize that an idea of theirs is wrong are like a population of organisms that are too specialized in their lifestyle to adapt to any sudden change in their environment, resulting in their extinction. Fortunately, the progress of science continues even in spite of such incidents, just as life on Earth has continued despite the mass extinctions that have wiped out most species that evolved on Earth before.