HUMZA Yousaf described the Scottish Government's court defeat over Westminster vetoing Holyrood's gender reforms as a “dark day for devolution”.

But Lady Haldane’s judgment made clear the veto was devolution in action, not devolution denied.

The mechanism was not, as the Scottish Government argued, “an impermissible intrusion upon the constitutional settlement [but].. an intrinsic part of it”.

If the day was dark for anyone, it was for a foolhardy First Minister, his deputy Shona Robison and the Lord Advocate, Dorothy Bain KC.

It was Ms Robison, in her previous role as social justice secretary, who led the Gender Reform Recognition Bill (GRR) through Holyrood.

It was Mr Yousaf who made it a point of principle to challenge the Section 35 Order which Scottish Secretary Alister Jack used to block the Bill from becoming law.

And it was Ms Bain, the Scottish Government’s most senior law officer, whose arguments attempting to overturn that Order were universally rejected by Lady Haldane.

Make no mistake. This is not a narrow defeat for the Scottish Government and Mr Yousaf’s decision to go to court come-what-may. It is a comprehensive demolition job. 

Lady Haldane unpicks and casts aside almost every angle advanced by Ms Bain.

Nothing of substance survives, and the prospects for a successful appeal look bleak.

Seeking to have Mr Jack’s decision declared legally invalid in a judicial review, Ms Bain argued it was unlawful, irrational, based on errors in law, informed by inadequate and “hostile” evidence, and lacked credible reasons to justify it. 

Moreover, it was not genuinely motivated by Mr Jack’s stated aim of preventing the GRR having adverse effects in reserved equality law, but by a political “policy disagreement”. 

Lady Haldane took the last point first. Based on what was before her, she could not conclude the Order was made on that basis, even if Edinburgh genuinely suspected it.

There was nothing “that would permit me to conclude or draw the inference that an impermissible motive, such as a policy disagreement, underlies the decision”.

Ms Bain also argued the Order was invalid as it failed to meet the tests set down in the 1998 Scotland Act for its use - that it could only veto a Holyrood law that would modify reserved law; that the Scottish Secretary must have reasonable grounds for believing it would have an “adverse effect” on the operation of reserved law; and that he must identify reasons.

Ms Bain argued none of these tests were met. Lady Haldane said they all were.

She said the creation of a new Scottish Gender Recognition Certificate would indeed modify the operation of reserved equality law “in substance” if not the letter of it.

The power was not, as Ms Bain argued, an “unfettered one”.

Section 35 “does not, in and of itself, impact on the separation of powers or other fundamental constitutional principle. Rather it is itself part of the constitutional framework.

.Ms Bain’s argument that the decision was irrational as Mr Jack failed to acquaint himself with relevant facts before making the Order also failed.

Lady Haldane accepted the UK Government’s argument that Mr Jack couldn’t be expected to do as much work as the Scottish Parliament on the issue, or produce statistical evidence when he was using his “predictive judgment” about possible future consequences.

He only had four weeks under the law to decide whether to make the Order, he could only do so after the Bill was passed, and as he was worried about adverse effects, it was not surprising or sinister that most of what he considered was about downsides.

Lady Haldane said it was possible another Scottish Secretary might have reached a different decision, but “its predictive nature means that there is possibly no single right answer”.

The court should only intervene if he had acted in a way no reasonable person would have. 

She also rejected arguments that Mr Jack took his decision after irrelevant considerations - “I do not consider that this criticism is made out” - and exaggerated the impact of two legal sex regimes within the UK on social security systems and fraud - “this challenge fails”.

As for the reasons he supplied, while some “might be thought to be less weighty” than others, she rejected the argument they were unsupported by evidence and unreasonable, especially as the 1998 Scotland Act didn’t specify any standard they must achieve.

Mr Yousaf said he went to court on a principle. After this judgment, that’s all he has left.