The Prayut government is good at claiming the legal high ground.
It has put together a complex web of laws and legal interpretations that so far has served well in justifying its continued existence.
But the legal tomes, and arguably self-serving interpretations, could backfire and end up tightening the noose around its neck now as more disputes have arisen.
The arbitration with Australian company Kingsgate is one such case.
In 2016, Prime Minister Gen Prayut Chan-o-cha used his power under Section 44 of the interim constitution to suspend production at the Chatree gold mine in Phichit and Phetchabun on grounds that its activities were harmful to the environment and health of nearby residents.
The mine was operated by Akara Resources Plc, a subsidiary of Australian company Kingsgate Consolidated Ltd.
Kingsgate disputed the government's claims that its activities resulted in toxic leaks. The company also entered into an arbitration process arguing that the government's order was unlawful under the Thailand-Australia Free Trade Agreement and caused substantial damages. Kingsgate said it would seek a range of remedies including compensation thought to be 36 billion baht.
Why is this case a testbed of how Gen Prayut could become a victim of his own propensity to use the law to advance his own agenda?
The thing is Gen Prayut broke away with tradition when he installed himself as prime minister instead of appointing a civilian government after staging the coup in 2014.
Giving himself absolute power under Section 44 overriding all three legislative, executive and judiciary branches was unprecedented too. The executive power was not only unlimited but also came with impunity.
It was a convenient tool for Gen Prayut as head of the NCPO to take swift action including transferring high-ranking officials and amending laws concerning pressing problems such as IUU and ICAO issues.
But such all-assuming power could appear ambiguous under the usually precise legal framework. It might not conform to international legal standards either.
When Gen Prayut wanted to be considered for the premiership, a dispute arose. Some sections in the constitution prohibit "state officials" from competing in the race to be voted as prime minister.
Eventually, some 110 MPs sent a petition to the Constitutional Court to determine Gen Prayut's status. In 2019, the court ruled that Gen Prayut in his capacity as head of the NCPO was not a state official.
The court said the NCPO chief was not under the command or supervision of the state, and the position was not appointed by any laws. Under this interpretation, Gen Prayut was qualified to serve as premier.
The issue with Kingsgate, however, recently came up because a document was circulated which showed that a budget of some 100 million baht was set aside for the government to fight the arbitration.
Government critics wonder why the Thai government or public have to be responsible for the dispute when Gen Prayut, who made the decision, was not a "state official".
Besides, when Gen Prayut was presented with some options that the government could take regarding the arbitration in 2019, he told the cabinet he would "take responsibility" for the mine closure.
Who knows what the PM's "responsibility" means? Does it mean Gen Prayut will pay Kingsgate out of his own pocket if the arbitration rules in the mine operator's favour?
Does it mean he would resign?
Or he could say he had done his best with the supranational power. He could not be held more responsible than that because he was not a "state official" after all.
The Kingsgate case is just one example of how the Prayut regime's ability to use the law to its own advantage is coming back to bite it.
Look at the constitution. The document must be the pride of the regime. It prescribed a complex electoral system which almost made sure that the most popular party wouldn't become government.
It also installed a fully appointed Senate, selected by Gen Prayut the NCPO's chief which would proceed to vote for Gen Prayut as the PM candidate.
With pressure mounting from anti-government protesters, even the government now admits that the constitution must be amended. But that could just be a move to calm the discontent while searching for a new angle to maintain its dominance.
The long arm of the law may not sound so inspiring for many Thais questioning the efficiency of the justice system. But how the law should be used and how justice should be served may be catching up with the Prayut regime after it seemingly flouted it for years.