Disagree: They are legitimate until/unless they are declared illegitimate.
You can't retroactively determine ontology. You're abusing and misunderstanding John of St. Thomas et al. I urge you to look into Father Chazal's position.
They are real legitimate popes now, but then in the future it'll be true that in the past they were not legitimate. That's bonkers.
It's like a marriage annulment. Let's say a woman was baptized and got a civil marriage. 10 years later the Church declares the marriage null. Was it legitimate during those 10 years simply because the Church didn't pronounce on it later. Church's declaration doesn't determine the reality.