Wasn’t the Catholic Church wrong in condemning Galileo and therefore fallible in what it teaches?
The Church freely admits that Galileo’s tribunal was wrong in certain respects, but that does not in any way “disprove” the Catholic Church’s claim to infallibility.
The Church never has claimed its ordinary tribunals to be infallible. They have disciplinary and juridical authority only; neither they nor their decisions are infallible. Only a pope or an ecumenical council is infallible, and then only in special circumstances.
While the Holy Office’s condemnation was ratified by Urban VIII, there are three conditions which must be present in order for a pope to exercise the charism of infallibility: He must speak in his official capacity as the successor of Peter; he must solemnly define a doctrine relating to faith or morals; he must indicate the doctrine is to be held by all the faithful. In Galileo’s case the second and third conditions were not present, and possibly not even the first.