There are many quotes throughout the history of the Catholic Church that state that a pope can become a heretic. Here’s one quote from a book found in Google books from around 1900 that mentions a discussion that was had among the Church Fathers at the First Vatican Council where they confirmed it is possible for a Pope to become a heretic and what would happen if that came to be:
“The question was also raised by a Cardinal, “What is to be done with the Pope if he becomes a heretic?” It was answered that there has never been such a case; the Council of Bishops could depose him for heresy, for from the moment he becomes a heretic he is not the head or even a member of the Church. The Church would not be, for a moment, obliged to listen to him when he begins to teach a doctrine the Church knows to be a false doctrine, and he would cease to be Pope, being deposed by God Himself. If the Pope, for instance, were to say that the belief in God is false, you would not be obliged to believe him, or if he were to deny the rest of the creed, “I believe in Christ,” etc. The supposition is injurious to the Holy Father in the very idea, but serves to show you the fullness with which the subject has been considered and the ample thought given to every possibility. If he denies any dogma of the Church held by every true believer, he is no more Pope than either you or I; and so in this respect the dogma of infallibility amounts to nothing as an article of temporal government or cover for heresy.” Abp. John B. Purcell, quoted in Rev. James J. McGovern, Life and Life Work of Pope Leo XIII [Chicago, IL: Allied Printing, 1903], p. 241; imprimatur by Abp. James Quigley of Chicago