Donation Of Constantine

The so-called Donation of Constantine is a letter supposed to have been written or dictated by the Roman emperor Constantine the Great. It is an imperial decree granting the Papacy authority over the lands of the Western Roman Empire and specifically of the city of Rome itself.

It's a forgery to be sure, but for the longest time it was held up by papists to be factually historical. However, later scholars (including priests and members of the curia) debunked it. The modern papacy admits that it is a fake, although a few true zealots here and there have tried to resurrect the Donation's authenticity.

Contradiction of Faith & Morals:
The modern Catholic Church has clearly taught that the Pope, having been gifted with an indelible mark of sanctity and infallibility, is protected by the Creator Himself from making errors in judgement on any matter related to faith and morals. And yet, here, for several centuries, we find the early medieval Popes avowedly using a forged imperial decree to assume power for himself and his organization.

How is this not a direct contradiction of modern Papal Infallibility?

References:
-https://en.wikipedia.org/wiki/Donation_of_Constantine

-https://www.thoughtco.com/the-donation-of-constantine-1221782