But if the legitimacy of a particular pope is not in the category of a dogmatic fact, then how can we be dogmatically certain of any dogma promulgated by that same particular pope?
That's a digression that's beyond the scope of this thread, but there is a minority opinion that considers the certainty regarding promulgated dogmas to be a combination of the Universal Church's acceptance and adherence to them together with papal promulgation.
Let's take the dogmatic definition of the dogma of infallibility. To say that the dogmatic definition of infallibility is dogmatically certain because it's certain that Pius IX was the pope is rather circular. If you don't believe in papal infallibility in the first place, then you wouldn't accept it merely on the basis of Pius IX's definition ... just as the Old Catholics rejected it. But if you look at Pius IX's argument against and condemnation of the Old Catholics, he appealed to the overall indefectibility of the Universal Church in accepting the dogma. So IMO there's some kind of continuation of that same principle at work.
Let's say some guy had transgender surgery and then hormone therapy, etc. to the point you couldn't tell he wasn't a man, but then got elected Pope. Or let's say that they did in fact imprison Paul VI in a dungeon and put some imposter out there. Let's say a Pope were, oh, invalidly elected.
How can you be DOGMATICALLY certain that none of these conditions apply? In and of itself you can't, and therefore there can be no dogmatic certainty about such matters. Now, the appeal then goes to God's Providence for the Church, i.e. that the Church could not be fooled into accepting a false Pope. I put that into the same category of "pious believe" that St. Robert ascribed to his opinion regarding a heretic pope. But it's not theologically impossible for there to be a case of mistaken identity OR a case of uncertain identity (the Great Western Schism). Some even go so far as to have invented based on this pious believe the notion of "Universal Acceptance", but the principle it rests on would be that the
Ecclesia Credens can't accept a false rule of faith. Well, the entire Church cannot accept a false dogma, so that alone would suffice for how a dogma can be dogmatically certain without the need to posit that the identity of the Pope is dogmatically certain, just as it sufficed during the definition of papal infallibility itself.
So the Church's inabillity to accept false dogma combined with a moral certainty regarding the identity of a Pope suffice to dogmatically guarantee the dogma itself, without having to posit an independent dogmatic certainty regarding something that is not INTRINSICALLY knowable with dogmatic certainty, since, after all, how is it in the Deposit of Faith that THIS MAN, Jorge, is currently the legitimate Pope? It's not and cannot be part of the Deposit, and that's the thinking of those theologians who consider papal legitimacy to NOT be dogmatic fact.
So ... I digressed anyway.