There is a difference between personal sin and teaching error. Popes have not taught error.
Popes can definitely teach error when not speaking ex cathedra and they have done so.