Well, he was an honored guest of the Pope for a while. Then he made fun of his host in a published book while claiming that he had a proof when he just had a theory and was told to please stop claiming that his theory required a change in theological interpretations of the book of Joshua (but he might continue teaching his theory about terrestrial movements without claiming that they were necessarily true).
https://www.catholic.com/tract/the-galileo-controversy