There is a way to square judicial lawmaking with the idea that “protected expectations” should be, well… protected. It is to say that judges legislate natural law and its consequences. One difference between natural and positive law is that natural law need not be promulgated, i.e., publicly announced by the authorities. It’s already written on people’s hearts; even children know that “you shall not steal.”
That’s not to say that discovering and applying natural law is trivial, for it takes wisdom to do so correctly, and I have already suggested that it is precisely wisdom that determines the quality of a judge; only that a single man can be up to the task. The legislature is a deliberative body, where a long conversation can be had about the utility of a particular positive law. The legislature can providentially care for the entire legal system, so balancing it as to nudge society toward the greatest good for the greatest number. A judge is a single man, yet individual natural laws are within his purview.
But it is the feature of natural law then that if one is in violation of it, then even if the law is not on the books, nevertheless, he should have known and obeyed it from the beginning. The “legislation” does not upset protected expectations, because the natural law has always been in force and should have been followed by the parties involved in the dispute as faithfully as any positive law requires. If one broke the natural law, then he is guilty even if the law has never been stated explicitly or promulgated.
This is unlike some government regulation which no individual could possibly have foreseen.
As for punishment, we can follow Rothbard and make it proportional to the crime.