I guess the question is, how can a true pope teach decree and judge anti-Catholic teachings which, per Catholic doctrine, must be submitted to with intellect and will? The traditional teaching is that teaching from a pope must be presumed to be true and even if learned theologians have objections they must still exteriorly assent to the teaching and ask clarifying questions or raise objections privately to the pope. Unless you are a learned theologian you are bound to submit per the teaching authority of the Church. This is not because the teaching is per se infallible, but because the pope has the authority to teach. Although there is a chance this teaching could contain a minor error not afecting salvation, it could never contain heresy or else the Church would be requiring its faithful to damn themselves which is absurd.
The short answer to your question is; the only time a pope cannot teach error is when he defines a doctrine, period, other than that, he can teach whatever errors, blasphemies and heresies his heart desires - as the conciliar popes continue to demonstrate. The sedes deny this because they wrongly believe it to be a doctrine of the Church that the pope is always, or nearly always infallible, and on that account we owe him blind obedience.
This wrong belief means that the sedes have effectively trapped themselves in a state of consistent confusion between truth or doctrine, and the requirement of obedience to authority. This wrong belief manifests itself as a doctrine that teaches;
"the only thing we have to worry about is doing what the priests and bishops and the pope tell us". This "doctrine" wrongly invokes authority as the supreme rule of faith, in so doing, it relieves the people of their religious obligations. This is the reason, played out in real time for 60+ years for our benefit, why authority is not the rule of faith, dogma is.
There have been plenty of popes who taught error, albeit nowhere near the extent that the conciliar popes have. Fr. Hesse has a good video on that subject on Youtube.
No, we do not need to be a learned theologian to know what error is, if that were the case, only [some] theologians would be in heaven. Use yourself as an example - you know the conciliar popes teach error and you're no theologian, I can assure you that the reason you know they preach error, is most assuredly *not* on account of their legitimacy or illegitimacy.