Cantarella, you're referring to things written by saints in previous centuries.
The dogma to which I refer was given ex cathedra definition in A.D. 1302, while St. Thomas had died a quarter century before that.
If he had lived after 1302, who knows what he would have written? Certainly he would have subjected himself and everything he wrote to the authority of the Pope. He also denied the Immaculate Conception, but that would not be defined until 1854, 6 centuries later.
St. Thomas Aquinas had a vision in which he was so terrified of what he had written in his Summa Theologiae, that when he awoke he commanded his servant to burn his books in the fireplace. His servant, however, disobeyed, and therefore we have the Summa today.
So even the Angelic Doctor recognized his personal fallibility, and was willing to give up all his years of laborious study and authorship for the sake of doctrinal purity.
That just means that the teaching existed previously, even before the dogmatic definition. Otherwise St. Thomas would not have written a chapter about it. The ex-cathedra
Papal definition confirms that St. Thomas was correct on this point (subjection to the Pope of Rome necessary for salvation).
And the fact that he is writing against the Greeks (who undoubtedly have the Faith in Christ -at least the minimum truths necessary for salvation- and also, valid sacraments) means something.