a book by Copernicus, who like Galilleo was also Catholic, which posited the sun as the center of the solar system.
Galilleo also had support from the pope early on, but he was a cantankerous sort, insulting a lot of people unnecessarily and making enemies along the way.
Allegedly, he was also wrong in some of his calculations and other scientists were pointing out those errors, throwing some doubt on his heliocentric theory.
Galilleo was also expounding upon the bible and that got him into trouble with the Vatican which told him that was not his area of expertise and to quit with the preaching.
Galilleo was right in his exposition on the bible and upon his heliocentric theory, but it would seem that he hadn't quite got all of the science down in explaining how he was right in that regard.
https://www.quora.com/Why-did-church-authorities-threaten-Galileo-when-he-revealed-that-the-Earth-is-not-the-center-of-the-solar-system?share=1
https://www.ewtn.com/catholicism/library/galileo-galilei-10544
https://www.ewtn.com/catholicism/library/catholic-church-and-galileo-2643
https://www.ewtn.com/catholicism/library/galileo-affair-4083