Then how can the Pope be taken seriously when he claims to speak “ex cathedra”?
The former assertion would amount to claiming that the Pope possessed the gift of inspiration, which would effectively make everything he said equal to Scripture. That is heresy from a Catholic POV.
The latter is an assertion about what the Pope won't teach … nothing more. It's a claim that the Holy Spirit will prevent him from teaching something erroneous (concerning faith and morals) as dogmatic truth.
Despite the attempts of Protestant apologists to paint Catholics as believing that the utterances of Popes are equal to Scripture, that is not in fact what we believe.