Almost by definition, the idea of an absolute monarchy presupposes that the distinction between what's legal and what the king wants is murky so the whole question feels anachronistic in several ways. Many features of our thinking about criminal justice were only formalised or generalised later. That includes the Nullum crimen, nulla pœna sine lege principle, i.e. the notion that crimes and punishments must be defined explicitly in the law, and much thinking about the hierarchy of norms and legality.
Concretely, in absolutist ancien régime France, all justice proceeded from the king. Judges and tribunals were regarded as justice déléguée but the king retained the right to judge any matter himself (justice retenue). Historically, preexisting courts (because absolutism was only established and theorised quite late) were brought into this system after the fact and justice rendered by local aristocrats was considered to be justice concédée (i.e. ultimately legitimised by the king).
So the king could take hold of a case and dispense any punishment he saw fit without having to provide any justification. That included declaring someone innocent, increasing the punishment or summarily imprisoning or exiling someone (thus stopping potentially embarrassing cases immediately). In fact, the practice of imprisonment itself was created ex nihilo by the king as laws and customs only envisioned death and exile as punishments (usually however, the case would run its course and the family would then petition the king's officers to have the punishment reduced to a prison sentence).
One instrument of this justice retenue, the lettre de cachet was especially controversial. They were used (among many other uses) to imprison mad people or prostitutes without any basis in written law or sometimes to have people detained at the behest of their family. In this case, crime and punishment were just a matter of tradition and convenience, the king could in principle simply ignore them and if he does nothing, they are not illegal per se.
Under Louis XIV, the king also codified various types of lettres de justice. The lettre d'abolition was something we might recognise as a modern pardon, simply cancelling a punishment. But the king could also grant a lettre de réhabilitation (which would restore the “honour” of the person) or a lettre de rémission (which would pardon someone for their actions and stop criminal proceedings immediately, even before they have been found guilty).
You also have to consider the fact that at the time France had nothing like a well-functioning criminal justice system. By modern standards, it was a pretty lawless place, often in the grip of civil war under Louis XIII who had to retake several French cities from the protestants, and during the minority of Louis XIV. In fact, the Fronde was in part a push back from the aristocracy against absolutism but it was not a conflict that played out in front of some independent court system debating the legality of this or that decision, it was a military conflict.
In this context, it's difficult to see the monarch ordering someone to rob a bank and people wondering about the “legality” of the whole thing. Incidentally, instead of ordering a robbery, the king could also simply use his powers to dispose of and dispossess powerful opponents and give their wealth to someone else. And yes, he could have someone killed without relying on some written law or special court.