IT seemed slightly surreal to be sitting in Court No 1 at the Court of Session yesterday preparing to hear if the Prime Minister of the United Kingdom was to be held in contempt of court.

Things have reached a sorry state when such a development is even being contemplated. The simple fact that Boris Johnson could be even partly accused of contempt of court is mindboggling - the last major contempt case ended in Tommy Robinson getting nine months in jail, don’t forget.

READ MORE: Tory cabinet ministers criticised for wine bet on Brexit vote

It all depends on how the judges view his actions. There is no doubt that he complied with the letter of the law, even if there are some who query whether the unsigned letter to Donald Tusk has legal standing.

The National: Donald TuskDonald Tusk

But it’s not about the letter, it’s about the spirit of the law, and The Government’s lawyers told the court that Johnson accepted “that he is subject to the public law principle that he cannot frustrate its purpose or the purpose of its provisions”.

The fact that he sent a second letter telling the EU to ignore his first, unsigned, letter would appear to be pretty compelling evidence that the Prime Minister was trying to frustrate the provisions of the Benn Act, contrary to the undertakings given to the court by his legal team.

And did Johnson speak to EU leaders to urge them not to grant an extension? Again that’s something his legal team implied he would not do.

Telling fibs to the people on the side of a bus is one thing, but telling porkies to the highest civil court in Scotland is another. Oh, and for the avoidance of doubt by any pro-Johnson Brexiteers reading this, the Prime Minister and all the ministers of the UK Government are subject to scrutiny by the Scottish courts as much as they are by the High Courts of England, as has been accepted by the UK Government.

The National: Prime Minister Boris JohnsonPrime Minister Boris Johnson

It should be axiomatic that the Prime Minister would never do anything unlawful, yet he has already been shown by the Court of Session and the UK Supreme Court to have acted unlawfully over the issue of the prorogation of Parliament.

READ MORE: Scottish judges delay ruling on Boris Johnson Brexit case

Surely, however, Johnson would never commit contempt of court. Yet that issue is being seriously considered by the three judges who form the most senior civil court in Scotland.

No-one else in the court yesterday could make the decision as to whether Johnson is in contempt of court. It is entirely a matter for the judges and there is no "prosecution" in this case.

Joanna Cherry, Jolyon Maugham and Dale Vince have asked the court ensure that Johnson abides by the Benn Act and does not frustrate its intentions. Most tellingly, the Act says that if the EU offers an extension, the UK Government must accept it.

That is the fundamental issue that will come back before the Court of Session. If the EU says we will give you an extension until January 31, for example, then Johnson must accept it or face the court, this time looking at a serious charge of contempt.

He could, of course, get his deal through Parliament and have all the legislation passed by October 31. If so, this case will fall. If not he is faced with the ultimate dilemma - either comply with the Benn Act fully or face the court’s wrath. Maybe time to dig a ditch, Boris.