I agree, to an extent - the motivations for the trial were far more personal than scientific.
Galileo was a great scientist, but not so great as a politician. He was buds with the current Pope at the time of his trial (and the previous one), which gave him a lot of latitude. Unfortunately, he pushed it too far.
The main position of the Church was not anti-helocentrism, it was a sort of overriding conservatism. It simply did not want scholars stirring up controversy over anything, on the theory that controversy could only harm the Church as an institution. The Church was perfectly willing to allow Galileo to publish, but not is such a way as to stir up animosity - everything had to be raised as “hypotheticals”, not stated as facts.
Problem was that Galileo had made lots of personal enemies, who had no hesitation about using the Church’s bureaucracy as a way to stab him in the back - and the Church was, to a point, willing to go along with it, just to keep Galileo (and his enemies) quiet. However, because Galileo was buds with two popes in a row, he was able to avoid significant trouble. In effect, Galileo and his enemies checked each other - neither could force a resolution.
Until, that is, Galileo screwed up, and pissed off his bud the Pope.
What happened was this: Galileo assumed that he had been told he could publish his theories (as “hypotheticals”, with a wink and a nod, to satisfy the Church’s bureaucracy). The Pope, his friend, basically imposed on Galileo to publish his own (silly) theories in his book. Galileo complied - but in such a way as was guaranteed to piss the pope off. He published the theories in the form of a “Dialogue”, and put the Pope’s contributions into the mouth of the character “Simplicio” (meaning, “simpleton”), and made this guy the butt-monkey of ridicule.
Unfortunately for Galileo (in a way), this “Dialogue” became a best-seller, and the ridicule of the Pope widely known.
The Pope, understandably, was unhappy with being portrayed as a fool (and in a best-seller at that), all the more so as he had considered Galileo his personal friend, and so withdrew his protection - leaving Galileo exposed to the malice of his enemies, as expressed through the Church bureaucracy.