https://www.history.com/this-day-in-history/galileo-is-accused-of-heresy
Actually science had known for years that the sun and not the Earth was the center of the universe. The Catholic church was in charge at the time and didn’t like that. Science didn’t question him. The law didn’t question him. The Catholic church did. The same body of scholars killed many to preserve their “authority”. Hardly a triumph of law, justice or science. The man was hung out to dry even by his fellow scientists for going against the “agenda”. Same thing is happening today.
He was too famous to kill, so yeah, they locked him up. Any “prison” or loss of right, no matter how “nice or luxurious” is still a prison.
While playing golf I saw a large naked-eye sunspot at sunset in the summer of 1991. I was reminded that Galileo had to recant his assertion that the sun had spots. His answer was “but it does.”