Which sacraments can be administered validly but illicitly? There are several questions on this site dealing with the difference in licit and valid when it comes to sacraments. A good starting point might be this one.

On this basis one can sort administered sacraments into four categories:


valid and licit (should be the majority of all administered sacraments)
invalid and illicit (does occur but is not of particular interes for me)
invalid but licit (does not occur as all invalid sacraments are Illicit)
valid but illicit


The last one is of interest within this question: Several examples for this can be found on this site as: Layperson baptizing children without them being in danger of death or priestly ordination without papal approval.

What I ask: Could you provide a list of (a) examples cases of validly but illicitly administered sacraments for each of the 7 sacraments where this might occur and (b) for the other sacraments a reason why this case might not occur.
Any sacrament that is administered by a priest or bishop is administered validly but illicitly if all other requirements for validity are satisfied but the priest or bishop is excommunicated:

An excommunicated person is forbidden ... to celebrate the sacraments or sacramentals and to receive the sacraments.
(Code of Canon Law, Canon 1331 section 1)

That covers all the sacraments except marriage, which the priest does not administer.
Suppose however that the minister of the sacrament is not excommunicated. Then the following seems to obtain:
Baptism
In the case where the priest or bishop is not excommunicated, baptism can be administered validly but illicitly if the infant is not in danger of death, and the one baptizing has not obtained the consent of at least one parent:

Canon 868 section 1: For an infant to be baptized licitly:
Note 1. the parents or at least one of them or the person who legitimately takes their place must consent;
Canon 868 section 2: An infant of Catholic parents or even of non-Catholic parents is baptized licitly in danger of death even against the will of the parents.

Confirmation
Confirmation can also be thus administered if the confirming bishop is doing the confirmation in another diocese, to residents of that diocese, without it being reasonable to assume that the bishop of that diocese has given permission:

To administer confirmation licitly in another diocese, a bishop needs at least the reasonably presumed permission of the diocesan bishop unless it concerns his own subjects.
(Canon 886 section 2)

Penance
Confession/Penance/Reconciliation appears to be performed either validly and licitly, or else invalidly and illicitly. It appears that it cannot be valid but illicit.
The sacrament requires permission (a &quot;faculty&quot;) from the bishop of the diocese to perform; but a priest without this faculty administers confession not only illicitly but invalidly.

The valid absolution of sins requires that the minister have, in addition to the power of orders, the faculty of exercising it for the faithful to whom he imparts absolution.
(Canon 966 section 1)

Orders
Ordination is also illicit if a Latin rite bishop ordains a man of an Eastern rite church without permission from the Holy See:

If not impeded by a just cause, the proper bishop is to ordain his own subjects personally; without an apostolic indult, however, he cannot ordain licitly a subject of an Eastern rite.
(Canon 1015 section 2)

Marriage
It appears that marriage can be valid but illicit if the parties are wedded above the age required by canon law (16 for men, 14 for women) but below the age required by the local episcopal conference:

A man before he has completed his sixteenth year of age and a woman before she has completed her fourteenth year of age cannot enter into a valid marriage.
(Canon 1083 section 1)
The conference of bishops is free to establish a higher age for the licit celebration of marriage.
(Canon 1083 section 2; emphasis added)

Eucharist
It appears that a priest who is not under some form of canonical penalty (such as excommunication) celebrates the Eucharist both validly and licitly. Canon law gives a list of canonical provisions to be observed. For example, the priest cannot celebrate the Eucharist all by himself, nor more than once a day without permission of the bishop. But the law does not specify that failing to observe these makes the celebration illicit.

A priest not impeded by canon law celebrates the Eucharist licitly; the provisions of the following canons are to be observed. ...
(Canon 900 section 2)

Anointing of the Sick
I cannot find anything in the Code that specifies circumstances under which the Anointing is celebrated illicitly.
Thus it appears that under ordinary circumstances, baptism, confirmation, orders, and marriage may be celebrated validly but illicitly; and if a priest is excommunicated, any of the sacraments may be thus celebrated.