Whereas South Australia v Totani (last note) illustrated the error of a legislature in depriving a court of its judicial function, Hessell v R  NZSC 135 illustrates a departure by a court (here, the lower appellate court) from its judicial function.
This is only hinted at obliquely. The Court was highlighting the inappropriateness of a formulaic approach to the level of sentence discount to be awarded for entry of a plea of guilty. The Court of Appeal in this case had issued a guideline judgment on discounts for guilty pleas, setting out a sliding scale according to the stage of the proceedings at which the plea was entered. The Supreme Court overruled that:
" The law reform agencies in the United Kingdom and New Zealand saw valid reasons to move to a more prescriptive and structured approach to giving credit for guilty pleas in sentencing. The Court of Appeal was persuaded by their reasoning. But in giving effect to their proposals, the Court of Appeal has underestimated the complexity of the issue including the potential of the changes to impact on the protected rights of persons charged with criminal offending. It is also inappropriate for a court to make changes in sentencing policy that would restrict the capacity of judges to determine sentences that are considered to fit all the circumstances of the case. Where the development of sentencing policy is motivated by a utilitarian calculus it may not be appropriate for judicial decision. Judges should show restraint in moving beyond the area mandated by existing legislation when exercising their sentencing powers. The ultimate difficulty we have with the Court of Appeal's approach is that it is not mandated by the Sentencing Act." [emphasis added]
The Supreme Court's approach recognises the need to avoid coerced guilty pleas, and to protect the defendant's right to dispute the facts and to challenge the admissibility of evidence.
Sentencing involves the consideration of a range of circumstances, one of which may be a guilty plea, and the significance of such a plea has to be assessed in all the relevant circumstances of the case. However, the Court added that discounts for guilty pleas should not exceed 25%, as remorse is a separate consideration for which more credit may be due.
The Australian approach (R v Wong  HCA 64, (2001) 207 CLR 584 at  per Gaudron, Gummow and Hayne JJ; R v Markarian  HCA 25, (2005) 228 CLR 357 at  per Gleeson CJ, Gummow, Hayne and Callinan JJ) was preferred to that in the United Kingdom, although New Zealand uses more of an "instinctive synthesis" of gravity and culpability than does Australia: Hessell at 55.
Fundamentally, the Court of Appeal had addressed the question from a point of view that was distorted by non-judicial concern with administrative efficiency.