No, they have not, and this is an article of faith. It is a required belief of the Catholic Faith, since it is a dogmatic teaching of the First Vatican Council:
“This gift of truth and never-failing faith was therefore divinely conferred on Peter and his successors in this See so that they might discharge their exalted office for the salvation of all, and so that the whole flock of Christ might be kept away by them from the poisonous food of error and be nourished with the sustenance of heavenly doctrine.”
Every Pope, Saint or sinner, liberal or conservative, is prevented by the grace of God from ever teaching heresy or any grave error, as this is contrary to the gift of truth. And every Pope is prevented by the grace of God from committing apostasy, heresy, or schism, as this is contrary to the gift of a never-failing faith.
No Pope can commit material heresy. No Pope can commit formal heresy. Material heresy is any idea that contradicts or is fundamentally incompatible with an infallible teaching of the Magisterium. God’s grace prevents the Pope from teaching material heresy, even inadvertently. Formal heresy is the deliberate knowing adherence to, or teaching of, material heresy. God’s grace prevents every Pope from committing this type of sin. Therefore, no Pope can be automatically excommunicated for apostasy, heresy, or schism, as God prevents these sins from ever occurring in any valid Pope.
The indefectibility of the Church is also dogma of the Catholic Faith. Therefore, Popes are prevented from any type of error or grave sin which would be incompatible with the indefectibility of the Church. In addition, the body of Bishops is prevented, by the grace of God, from ever accepting, as the Roman Pontiff, an invalid Pope or antipope. So, when a Pope is accepted by the body of Bishops, this confirms that he is the valid Roman Pontiff.
Accusations against Pope Honorius I and Pope John XXII for heresy are commonly found on the internet and in discussions about the papacy. However, neither Pope committed heresy in any way:
* Was Pope Honorius I a heretic?
* Popes Sin and Error (see the section on John XXII