A quarter of a century ago I was entrusted by Hungary with the task of persuading the international court of justice (ICJ), in The Hague, that it was entitled to terminate a treaty it had signed in 1977 with Czechoslovakia, on the grounds there had been a fundamental change of circumstance.

The court decisively rejected the argument in its judgment of 25 September 1997. The experience of arguing the point – a thrill for a young international lawyer – and the court’s judgment left an indelible impression: it is crystal clear that any effort to argue that article 62 of the Vienna convention might be invoked to allow the UK to get out of the Irish backstop envisaged by the withdrawal agreement is entirely without merit, however convenient it may become for the government to argue otherwise.

In 1977, Hungary and Czechoslovakia entered into a treaty to build two barrages on the River Danube, one near Gabčíkovo, the other near Nagymaros. The purposes of the agreement included the generation of electricity and strengthening of fraternal relations between two Soviet bloc countries.

Another Brexit crunch week: what could happen? Read more

A decade or so later Hungary decided it wanted to get out of the treaty. By the time the case reached the international court, in 1993, the world had totally changed. The Berlin Wall was gone, Hungary was on the way to joining Nato, Czechoslovakia had split into two countries and the Soviet Union no longer existed. It is difficult to imagine more fundamental or unforeseeable changes.

I appeared before 15 judges of the court, seeking to persuade them that the conditions of article 62 were met. I had to persuade the court that (1) a fundamental change of circumstances had occurred, (2) that it was not foreseen, (3) that the circumstances were essential, and (4) the change radically transformed the obligations still to be performed.

I failed, and the court decisively rejected my case. At paragraph 104 of the judgment it ruled that the changed circumstances advanced by Hungary were “not of such a nature, either individually or collectively, that their effect would radically transform the extent of the obligations still to be performed”.

The court ruled that article 62 had to be narrowly construed and could only be relied upon in “exceptional cases”, otherwise the “stability of treaty relations” would be undermined. It found that the change of circumstances did not radically transform the obligations still to be performed in order to accomplish the project, or were not unforeseen, or did not relate to matters that constituted an essential basis of the consent of the parties to be bound by the treaty.

The judgment in that case makes clear that the argument that article 62 could be invoked in relation to the indefinite application of the backstop is hopeless. The reason is simple. Article 1.4 of the protocol provides in clear terms that “the provisions of the protocol shall apply unless and until they are superseded, in whole or in part, by a subsequent agreement”. In his advice of 13 November 2018 the attorney general concluded: “It is difficult to conclude otherwise than that the protocol is intended to subsist even when negotiations have clearly broken down.”

Only our compromise can break the Brexit impasse | Phil Wilson and Peter Kyle Read more

Following the adoption of the joint instrument, and a UK unilateral Declaration, the attorney general’s additional advice confirmed his earlier view. He concluded, completely correctly, that in the absence of bad faith by the EU, “the legal risk remains unchanged” that the UK could be “indefinitely and involuntarily detained within the protocol’s provisions”.

The attorney general has fulfilled his mandate, offering independence advice. It is spot on. He has properly interpreted the protocol, and understood that while it does not reflect an intention to create a permanent situation, it allows for the possibility that the situation provided for may apply indefinitely.

Article 62 cannot be invoked where the circumstance that arises – the indefinite or extended application of the backstop – has been foreseen by the withdrawal agreement. Accordingly, it can offer no assistance. The argument that it could be invoked if negotiations broke down and the backstop pertained indefinitely is hopeless. It is not even arguable. Nor is the idea that the UK could somehow adopt its own interpretation, or laws, to get around the problem. The withdrawal agreement is an international obligation which trumps domestic law.

Moreover, it cannot even be said that article 62 really provides for a unilateral right of termination, as it is likely that the matter would come before the arbitral panel established under the withdrawal agreement. The arbitral panel would have to be persuaded that the extended (or even indefinite) application of the backstop was an unforeseen fundamental change of circumstance.

Given the unwillingness of the ICJ to find the collapse of the Soviet Union to be a fundamental change of circumstance, this is not an argument I would wish to be asked to make before the arbitral panel or the ICJ.

• Philippe Sands is professor of law at University College London

• This article was amended on 18 March. The reference to the “Lisbon treaty” has been changed to the “Vienna convention”