That business with Galileo would seem to indicate that "always" may not be entirely accurate.
On the flip side, the Church actually apologized for this - something you almost never see other such organized religions doing. I think the Southern Baptist Convention apologized for racism at one point. Anyway, being wrong is one thing but being able to admit it, rectify it, and recognize you are a religion of sinners is another.
One school has it that Galileo was not condemned for heliocentrism, which he, like Copernicus, was free to hold as a hypothesis, but because he claimed an untrammeled right to the private interpretation of Scripture, which the Church rejected, and rejects.
Another author insists that Galileo got into trouble, not because he disagreed with theology, but because he disagreed with Ptolemy; and that since almost all University professors at that time subscribed to a Ptolemaic cosmology, they finagled Galileo's persecution by the Roman Curia for reasons of professional rivalry.
A few things did strike me as having a certain piquancy:
(1)In the whole lengthy wrangle, Galileo had the support of a lot of bishops, carinals, and even Pope Urban VIII, his longtime friend--- whose support Galileo lost when he mocked him (maybe inadvertently, probably without malice) by putting Urban's words in the mouth of a character he called Simplicius ("the Simpleton") in an imaginary dialog about celestial models.
(2) The Church never had a doctrine on geocentrism; but most churchmen at the time (like almost all scientists at the time) had an underying paradigm of geocentrism. As such, the Cardinal-judges made a wrong judgment, one which wasn't based on doctrine. For that, the Church (very belatedly!) formally apologized.
(Everyone knows that Church tribunals ---as a function of politics, and not doctrine--- can be in error. One need only think of St. Joan of Arc, who was executed by an illegitimate ecclesiastical tribunal dominated by her political enemies, and later not only "apologized to" but canonized a saint.)