While it would be impossible for the last 5 or 6 papal claimants to be true popes given their profession of heresy...
It is important to recognize that this is a mere opinion of some reknowned theologians (opposed by other reknowned theologians), and not Church teaching.
According to Arnoldo da Silveira, nearly all the defenders of the opinion that "God will never permit that a pope should fall into heresy" (i.e., the "first opinion" in S. Bellarmine's classifications) -which include S. Bellarmine, Suarez, Bouix, Billot, Pighi, and others- did not hold this opinion as certain, but only as "more probable."
This means they did not consider it impossible that a pope could be a heretic, only improbable.
It is also important to recognize that the adherents of this opinion named above (with the possible exception of Pighi), only and precisely because they consider that opinion as
uncertain, go on to entertain other improbable positions (i.e., S. Bellarmine's classification of opinions 2-5),
arguendo.