How is Voltaire's statement that "it is dangerous to be right in matters about which the established authorities are wrong" correct?
Certainly, Voltaire's statement has validity whenever those in power are unwilling to allow challenges to their authority and desires even if this opposition contains the truth or is morally right.
The previous mention of Galileo (1564-1642) is a good example of the self-serving desires of those in power. Now known as the father of modern science, the astronomer Galileo expressed his support of heliocentrism. This belief challenged the doctrine of Aristotle and the established order set by the Catholic Church. Galileo's support of the heliocentric model was investigated and found to be
...foolish and absurd in philosophy, and formally heretical since it explicitly contradict[ed] in many places the sense of Holy Scripture.
Galileo defended his views in his Dialogue Concerning the two Chief World Systems. However, because this work seemed to attack Pope Urban VIII, Galileo was soon alienated from learned Jesuits who had previously supported him. As a result of this alienation, he was tried by the Inquisition, found "vehemently suspect" of heresy, and forced to recant. Galileo spent the remainder of his life under house arrest.
This statement is correct if it refers to areas in which the established authorities are more interested in retaining their power than they are in finding truth. In such cases, the authorities will generally be very much on the defensive because they will feel endangered by someone who is questioning their mistaken beliefs.
In areas where truth is not as valued as power, the people in power want to keep their position. Because of this, they will often stop at nothing to destroy those who are a threat to this power. Someone who can prove their ideas wrong is clearly a threat to that power and they will react strongly.
I would say this is especially true when the authorities know (or suspect) that they are wrong. In those cases they will be particularly worried about dissent for fear that their mistakes will be exposed.
The simple and clear meaning of the quoted statement of Voltaire is that it is dangerous to hold views that are opposed to those accepted and promoted by the established authorities. The danger in terms of probability of negative action and extent of damage is directly proportional to the validity of your views over those of the authorities.
Any views that oppose the views held and propagated by the authorities tend to threaten their authority and disturb the established order of the society. Greater the difference in views and greater the validity of alternative views, greater the threat felt by the authorities. In situation like this, it is quite predictable for the established authorities to protect themselves by trying to silence the all opposing views. History, has enough examples of authorities taking the extreme action of taking life of a person with valid and forceful new ideas. Two of the most well known example of this kind of action is provided by persecution of Socrates and Galileo