If the Bible seems to have erred, on any subject, the error is merely apparent. For it is an article of faith that the Bible is entirely without error on every subject about which the text of Scripture makes an assertion. Contradictions and alleged errors on physical science or history or any other subject are merely a result of our misunderstanding. For the Holy Spirit has made and kept the text free from all error.
Similarly, it is an article of faith — specifically, a dogma of the First Vatican Council — that the Pope has a never-failing faith. If he seems to have failed in faith, by apostasy or idolatry or heresy or schism, the error is merely apparent, and is due to our misunderstanding or to a false accusation or other explanation.
In both cases, when the explanation for the apparent error does not readily present itself to our minds, we must still believe by faith that the Bible in inerrant, and that the Pope is never-failing in faith. For both are guaranteed by Christ and by the Holy Spirit.
Jesus: “Scripture cannot be broken.” (Jn 10:35)
Jesus to Peter: “But I have prayed for you , so that your faith may not fail….” (Lk 22:32).