Not even in Novus Ordo textbooks have I read such a thing.
Even THEY say that there is such a thing as receiving sacraments unworthily and without any effect. They even give precisely this same example of the lifelong sinner who confesses on his deathbed, but since he never confessed in life when he was healthy, he didn't know how to do a good confession at the hour of death and consequently did not profit from the sacrament.
Go back to reading the catechism why don't you.
Oh wait, it's "heretical" and all you need is a Denzinger.
Ok, so we know now that you have no faith whatsoever in the sacrament. Fwiw, it is not up to any of us to decide whether he received the sacrament worthily or not, we who do not know what goes on behind closed doors cannot possibly know what his disposition was, all we can know is that he was a priest who was dying and that he received this sacrament, which as St. Thomas Aquinas says:
"This Sacrament prepares a man for glory immediately, since it is given to those who are departing from this life in the body."I supplied
this link earlier - spend 4 minutes and read it and learn what this sacrament does, and fyi, it does this whether you believe it or not.