This seems like an easy decision with which to comply -- as long as you're aware of it beforehand.
Can a judge order someone to pretrial mental health diversion? Yes. Of course. Can a judge order restitution? Same answer: Yes. Clearly.
But if you want to order restitution, you've got to do so before the two-year (or whatever) mental health diversion is over and you're about to dismiss the charges.
Not after.
So holds the Court of Appeal, reversing the trial court.
Again: An easy decision to follow, as long as you know of it.
Which now everyone (hopefully) does.