R_C exactly right in the quote: “the Catechism of St. Pius X says yes (It remits venial sins, and also mortal sins which the sick person, if contrite, is unable to confess)”.
The Anointing of the Sick is a sacrament of the living, so the administration of it also administers the Sacrament of Penance first, when properly disposed but incapable of confessing then. See Baltimore Catechism No. 3:
Q. 597. What do we mean by Sacraments of the dead and Sacraments of the living?
A. By the Sacraments of the dead we mean those Sacraments that may be lawfully received while the soul is in a state of mortal sin. By the Sacraments of the living we mean those Sacraments that can be lawfully received only while the soul is in a state of grace – i.e., free from mortal sin. Living and dead do not refer here to the persons, but to the condition of the souls; for none of the Sacraments can be given to a dead person.
Q. 598. Why are Confirmation, Holy Eucharist, Extreme Unction, Holy Orders, and Matrimony called Sacraments of the living?
A. Confirmation, Holy Eucharist, Extreme Unction, Holy Orders, and Matrimony are called Sacraments of the living because those who receive them worthily are already living the life of grace.
Q. 599. What sin does he commit who receives the Sacraments of the living in mortal sin?
A. He who receives the Sacraments of the living in mortal sin commits a sacrilege, which is a great sin, because it is an abuse of a sacred thing.
Q. 970. Will Extreme Unction take away mortal sin if the dying person is no longer able to confess?
A. Extreme Unction will take away mortal sin if the dying person is no longer able to confess, provided he has the sorrow for his sins that would be necessary for the worthy reception of the Sacrament of Penance.