The faults, failings, idiocies and sins of particular Apostles and their successors has nothing to do with the doctrines of the Church.
The pope having an erroneous opinion on climate science is like the pope having an erroneous opinion on the causes and cures of allergies. I mean, the man may have allergies but the rest of us don't have to sneeze.
“An” erroneous opinion? Try “plethora” of erroneous opinions.