Baptism of desire refers to a very specific context, namely that of the fate of the unbaptized who desired entry to the Church, but who died before they could be baptized. It does NOT make an unbaptized person in life into a baptized person. If a person was baptized invalidly, that is, not baptized, all the desire in the world will not make them baptized. And if they are not baptized, they do not validly receive Holy Orders. So what follows from that is that the sacraments performed by the unbaptized, and thus not ordained, priest would be invalid insofar as they require Holy Orders to work. Really that just leaves baptism as the only one that could be validly achieved. Others require either the power of orders alone or that coupled with jurisdiction (in the case of marriage and confession) in order to be worked validly.
In short, “baptism of desire” refers not to the objective state of one in life, it does not render an unbaptized person baptized objectively or ontologically, it merely refers to the state of a soul of an unbaptized person on their way into the Church who died before baptism.
-Fr ACEGC