Wales voted for Brexit – to the undisguised shock of nearly all its political and socio-economic elites. The Leave vote severely undermined the long-cultivated self-image of Wales: a vision, sustained by the nation’s long electoral aversion to the Conservative Party, of Wales as a more politically progressive nation than its English neighbour.

That vision was left looking threadbare by a Leave vote that followed on UKIP’s considerable electoral success between 2014 and 2016.

The Leave vote also ran counter to apparent economic self-interest. While the United Kingdom has long been a substantial net contributor to the EU budget, pre-referendum analysis by the Wales Governance Centre indicated that Wales is a significant beneficiary.

Wales – and particularly many of the South Wales Valleys, where the end of the long-dominant coal mining industry continues to leave a huge void – has benefited from substantial amounts of EU Structural Funding.

The peculiar shape of Welsh agriculture – mainly small-scale livestock farming – means that it has done well from Common Agricultural Policy financing, while much of the produce from Welsh farms is exported to other EU countries.

The rest of the Welsh private-sector economy depends heavily on a small number of large, export-oriented manufacturers who are closely linked the EU single market. That single market also has specific importance to certain Welsh communities: the vast majority of all physical exports from the Republic of Ireland transit through three Welsh ports.

In short, Wales potentially has a great deal to lose from Brexit. With these interests in mind, a consistent priority for the Welsh Government since June 2016 has been to try to secure the softest Brexit possible.

It published (jointly with Plaid Cymru) a policy paper setting out this position in January 2017. Yet Wales has little or no bargaining leverage within the UK: the Welsh Government can make no credible threat to London, nor does it have a public mandate to resist Brexit.

And, as Noah Carl and Anthony Heath note in Brexit: Local and Devolved Government, the idea that power should be devolved to the Welsh Assembly is less engrained in the Welsh electorate than in Scotland or Northern Ireland.

It is therefore unsurprising that such initiatives have largely failed to get Welsh concerns reflected in the UK government’s Brexit negotiating position. After the general election in June 2017, the Welsh Government’s focus shifted towards the domestic governmental implications of Brexit.

First Minister Carwyn Jones, his status and confidence boosted by having played the leading role in Labour’s successful Welsh election campaign, launched an ambitious new Welsh Government policy paper, ‘Brexit and Devolution’.

This advanced Jones’ long-standing argument for re-shaping the entire constitution of the UK: it called for “deeper and more sustained cooperation between devolved administrations and the UK Government after EU exit”.

However, once again, the initiative failed to resonate in Whitehall. Indeed, far from unleashing a new devolutionary impulse, the Welsh Government has subsequently found itself battling to resist what it sees as a substantial potential erosion of Welsh self rule.

The EU Withdrawal Bill, when first published in July 2017, immediately drew withering criticism from the First Minister who attacked it as a ‘power grab’.

This objection to the Withdrawal Bill stems from the fact that many major areas of devolved responsibility (such as agriculture, fisheries and the environment) have hitherto been exercised in a Europeanised context.

However, the Withdrawal Bill stipulated that these competences would ‘land’ in London post Brexit (depending on the model of Brexit that is enacted) rather than returning immediately to the devolved nations.

All governments in the UK – even the Scottish Government – recognise a need for cooperative frameworks in some of these areas. Carwyn Jones has often cited the example of livestock welfare regulations, arguing that it would make little sense to establish different regulatory rules in the different nations of the UK.

Yet how should any new frameworks be agreed? The devolved governments insist that, within the UK, devolved areas are devolved. Any powers thus ‘repatriated’ from the EU should therefore come to them.

The UK government insists it will ultimately adjudicate which repatriated powers are devolved, and which will return to Westminster. It argues that it should therefore hold any such powers in the first instance. The Scottish and Welsh governments see this as an attempt to reclaim powers in devolved areas, something they are emphatically not willing to countenance.

Beneath this problem is an almost total lack of trust between London and the devolved administrations. This is hardly surprising in the case of Scotland, whose government remains committed to eventually leaving the UK. It is more striking in Wales, whose government remains firmly committed to the union (while wishing to substantially re-shape it).

It is not simply about a Labour government in Cardiff distrusting a Tory-led regime in London. Much of the distrust stems from the lengthy process that culminated in the 2017 Wales Act, by which Westminster reshaped the Welsh devolution settlement.

This was seen by many in Cardiff, including the First Minister, as a poorly conducted power grab by Whitehall. Given the long-standing and deep enmity between Labour and the SNP, the joint statements by Carwyn Jones and Nicola Sturgeon on the Withdrawal Bill – in July 2017 opposing it’s introduction, and in September 2017 calling for deep amendments to avert a power ‘hijack’ from Westminster – have been striking.

They are perhaps the clearest testament to the UK Government’s rather clumsy handling of the internal politics of Brexit. With the devolution aspects of the Withdrawal Bill largely intact, there appears little chance of that Bill receiving legislative consent from either the Scottish Parliament or the Welsh Assembly.

The Supreme Court’s judgment in the Miller case indicates that the UK Government and parliament may be able to proceed anyway. A ‘Continuity Bill’ passed by the Welsh Assembly – to enshrine existing EU regulations in devolved areas in Welsh law – has been proposed by the Welsh Government. This too may prove inadequate before the Courts.

The only certainty appears the inevitability of further conflict between the UK government and its devolved counterparts.

By Roger Awan-Scully, Professor of Political Science at Cardiff University. You can read our full report, Brexit: Local and Devolved Government, here