Remember this is only under a very specific set of circumstances - when the Pope speaks "Ex Catedra". It hasn't been done since 1950 when the assumption of Mary was added to the Dogma of the Catholic Church.
As a lay Catholic, I found this a stumbling block years back, and I have seen people bring it up. It goes with the doctrine that the "gates of hell will not prevail", this doesn't mean that the Church itself or Pope can't face heretical ideas, or corruption, but that the dogma moral teaching can be infallible when announced in such a way (Ex Cathedra).
This is actually a Trad myth and is in contradiction to Catholic dogma. NOTE: Long post incoming, read the bolded and italic for the TL;DR version.
1578 - The prescription of the synod about the order of transacting business in the conferences, in which, after it prefaced "in every article that which pertains to faith and to the essence of religion must be distinguished from that which is proper to discipline," it adds, "in this itself (discipline) there is to be distinguished what is necessary or useful to retain the faithful in spirit, from that which is useless or too burdensome for the liberty of the sons of the new Covenant to endure, but more so, from that which is dangerous or harmful, namely, leading to superstition and materialism"; in so far as by the generality of the words it includes and submits to a prescribed examination even the discipline established and approved by the Church, as if the Church which is ruled by the Spirit of God could have established discipline which is not only useless and burdensome for Christian liberty to endure, but which is even dangerous and harmful and leading to superstition and materialism,--false, rash, scandalous, dangerous, offensive to pious ears, injurious to the Church and to the Spirit of God by whom it is guided, at least erroneous.
1683 - While, in truth, We laud these men with due praise because they professed the truth which necessarily arises from their obligation to the Catholic faith, We wish to persuade Ourselves that they did not wish to confine the obligation, by which Catholic teachers and writers are absolutely bound, only to those decrees which are set forth by the infallible judgment of the Church as dogmas of faith to be believed by all [see n. 1722]. And We persuade Ourselves, also, that they did not wish to declare that that perfect adhesion to revealed truths, which they recognized as absolutely necessary to attain true progress in the sciences and to refute errors, could be obtained if faith and obedience were given only to the dogmas expressly defined by the Church. For, even if it were a matter concerning that subjection which is to be manifested by an act of divine faith, nevertheless, it would not have to be limited to those matters which have been defined by express decrees of the ecumenical Councils, or of the Roman Pontiffs and of this See, but would have to be extended also to those matters which are handed down as divinely revealed by the ordinary teaching power of the whole Church spread throughout the world, and therefore, by universal and common consent are held by Catholic theologians to belong to faith.
1698 - Nor do they blush to profess openly and publicly the axiom and principle of heretics from which so many perverse opinions and errors arise. For they repeatedly say that "the ecclesiastical power is not by divine right distinct from and independent of the civil power, and that the distinction and independence of the same could not be preserved without the essential rights of the civil power being invaded and usurped by the Church." And, we cannot pass over in silence the boldness of those who "not enduring sound doctrine" [2 Tim. 4:3], contend that "without sin and with no loss of Catholic profession, one can withhold assent and obedience to those judgments and decrees of the Apostolic See, whose object is declared to relate to the general good of the Church and its rights and discipline, provided it does not touch dogmas of faith or morals." There is no one who does not see and understand clearly and openly how opposed this is to the Catholic dogma of the plenary power divinely bestowed on the Roman Pontiff by Christ the Lord Himself of feeding, ruling, and governing the universal Church.
1792 - [The object of faith] .Further, by divine and Catholic faith, all those things must be believed
which are contained in the written word of God and in tradition, and those which are proposed by the Church, either in a solemn pronouncement or in her ordinary and universal teaching power, to be believed as divinely revealed.
This page is the verbatim text of Pope John XXIII's 1962 opening speech at Vatican II, translated into English.
- Vatican II is a binding and infallible ecumenical council, proclaimed with magisterial authority.
To participants in the 68th National Liturgical Week in Italy (24 August 2017)
"And today, there is still work to be done in this direction, in particular by rediscovering the reasons for the decisions taken with regard to the liturgical reform, by overcoming unfounded and superficial readings, a partial reception, and practices that disfigure it.
It is not a matter of rethinking the reform by reviewing the choices in its regard, but of knowing better the underlying reasons, through historical documentation, as well as of internalizing its inspirational principles and of observing the discipline that governs it. After this magisterium, after this long journey, We can affirm with certainty and with magisterial authority that the liturgical reform is irreversible."