State of NSW v Kable  HCA 26 (5 June 2013) is a reminder of the law's foundation in pragmatism. To make the legal system serve its purpose of providing orderly resolution of conflicts, it is necessary that the orders of a court be treated as effective unless and until they are overturned on appeal. There would be chaos otherwise -.
So an order of a court for detention of Mr Kable was effective even though the legislation on which it was based was subsequently held unconstitutional. The order had not been set aside during the period of his detention, and his detention was pursuant to lawful authority of the order. He had not been unlawfully imprisoned. The officials who enforced the court order were right to do so.
Leaving that decision to one side for the moment, we can reflect on other instances where the law has to be pragmatic. A judge, or any other official who makes legally binding rulings, may appear to be doing so in a routine way, until someone points out that he was improperly appointed. He did not lawfully hold the office he appeared to hold. What then of all the decisions he had made?
But an official's appointment need not appear to be routine. A usurper may seize power, as in a military coup, sack the judges and "appoint" new ones. Life must go on. Ordinary legal problems must be resolved, ordinary laws need to remain enforceable. The uncontroversial orders of the obviously unlawfully appointed judges need to be obeyed, simply to avoid a worse breakdown of the social order.
One way to determine the de jure validity of the acts of de facto officials is to ask whether the person was in fact competent to exercise the jurisdiction in question, and whether the act of the official ought to be recognised. Are there circumstances of reputation and acquiescence, sufficient to colour the appointment and the acts with validity? See, for example In re Aldridge (1893) 15 NZLR 361 (CA) where a person had been appointed to a non-existent judicial office and his appointment had been held by the Privy Council to have been invalid: Buckley v Edwards  AC 387. The authorities concerning officials who appeared to have been validly appointed, but weren't, are reviewed in State v Carroll 38 Conn. 449 (1871). As to officials who have obviously been unlawfully appointed, and where colour of right does not apply, see Honoré, "Allegiance and the Usurper"  Cambridge LJ 214, and for the law's need to take into account revolutions or coups d'etat, Madzimbamuto v Lardner-Burke  1 AC 645 (PC). See also Jarrett, "De Facto Public Officers: The Validity of Their Acts and Their Rights to Compensation" 9 Southern California Law Review 189 (1936), and Brookfield, "The Courts, Kelsen, and the Rhodesian Revolution" (1969) 19 University of Toronto Law Journal 326.
Old stuff, discussion of which has no doubt been the foundation of many academic careers. I only mention it here because I am being nostalgic. Basically it is all about when and how the law should catch up with reality. The answer is not necessarily confined to whether the official was validly appointed or whether the law was valid.
So too in Kable, the question was more complex than mere validity of the law: . The position, long established in Australia, is that "the orders of a federal court which is established as a superior court of record are valid until set aside, even if the orders are made in excess of jurisdiction (whether on constitutional grounds or for reasons of some statutory limitation on jurisdiction)" . The effect given to the order that was made without jurisdiction comes from the status of the court, not from the invalid legislation, and the effect of the order continues until it is set aside on appeal . Here, the order detaining Mr Kable had been set aside by the High Court in 1996, but that was after he had been released from custody.
This was an unsuccessful action for damages for false imprisonment. Mr Kable's position may be likened to that of a person who has served a sentence of imprisonment but whose conviction was subsequently quashed. The remedy, if there is one (and states make their own – pragmatic - arrangements to deal with these situations), is not an action for damages in tort for false imprisonment, for the imprisonment was lawful.