As an example of how the scientific consensus has proven correct, let us take Einstein's theory of relativity. Einstein's claim that time and space were relative to an observer's frame of reference--in other words, that time and space are not absolute--may have contradicted Newtonian physics, but over time it has become accepted by nearly all physicists. The reason is that (so far, at least) all observational and experimental evidence has supported Einstein's theory. Consequently, according to Nancy R. Pearcey and Charles B. Thaxton:
The reception of Einstein's theory has been almost universally positive. While most scientific theories have both supporters and detractors, one searches virtually in vain for critics of Einstein's theory. Only a few scientists of high academic standing have been willing to express criticism, at least publicly. (The Soul of Science: Christian Faith and Natural Philosophy, p. 181)
On the other hand, as an example of how the scientific consensus has proven incorrect, let us take "ether theory." For some time, it was thought by scientists that light must travel through a medium of some sort. This hypothetical medium was dubbed "ether." After all, it was reasoned, light is a wave and other types of waves, like sound waves, must travel through a medium like air or water. Without such a medium--like in a vacuum--there is no sound. However, though the existence of ether was widely accepted among scientists, it had not been proven:
[Then] in 1887 two Americans, Albert Michelson and Edward Morely, ran what is considered by most scientists as the crucial experiment on ether. They reasoned this way: If the earth is moving through the ether, that motion ought to be detectable in the form of an ether "wind," just as the air surrounding a moving car can be detected by sticking a hand out the window and feeling the wind. The "hand" in the Michelson-Morely experiment was a beam of light. Two beams of light, to be precise, beamed in directions perpendicular to one another. The beam that ran against the ether wind should slow down (show an ether "drag") compared to the other.
But when Michelson and Morely ran the experiment, they were dumbfounded by the results. The two light beams traveled at exactly the same speed. Neither showed any of the expected "drag." Regardless of the direction the beams traveled, they always moved at exactly the velocity of light--neither more of less. (Nancy R. Pearcey and Charles B. Thaxton, The Soul of Science: Christian Faith and Natural Philosophy, p. 168).
The inevitable conclusion of this experiment was that--despite the scientific consensus in its favor--ether did not exist. And this is not the only case in which the scientific consensus was mistaken. For example, for some time it was thought that atoms were the absolutely smallest unit of matter--until subatomic particles were discovered.
Thus, as we can see, the history of science demonstrates that the existence of a scientific consensus around a certain theory cannot be absolutely dispositive. Sometimes a consensus is well-founded; sometimes it is not. Certainly, the fact that a majority of scientists believe a certain idea is true should cause us not to dismiss it out of hand; after all, it is not unreasonable to assume that those who are experts in a field are the most knowledgeable about the evidence in support of a particular theory. On the other hand, sometimes even the experts are wrong. There may be a number of reasons as to why a scientific consensus exists in support of a mistaken theory. It may be that there is an insufficient amount of observational or experimental evidence refuting the theory. Or it may be that scientists are reluctant to abandon an idea that has long been dominant in their field. It might even be the case that some scientists have so much emotionally invested in a particular theory that they are loath to give it up. Whatever the reason for it, a mistaken belief is still a mistaken belief.
In short, scientific facts are not determined by majority vote. They are determined by the evidence. This is something I believe we need to keep in mind as we consider scientific controversies.
Image of Albert Einstein from commons.wikimedia.org