A few years ago, a House of Lords committee conducted an inquiry into the Barnett Formula.

Among those invited to give evidence was the elderly Lord Barnett, a former Chief Secretary to the Treasury who had given his name to the funding mechanism in 1978.

But as a peer involved in the inquiry later told me, it quickly became clear Joel Barnett was one of several people who did not actually understand how the Barnett Formula worked.

Indeed, it’s the Schleswig-Holstein Question of its day, understood by very few people, some of them either dead, forgetful or simply not interested in figuring it out. And this group, remarkably, appears to include the Scottish and Welsh governments.

Last week those devolved administrations began a “formal dispute resolution process” with the UK Government over their “right” to receive “consequential funding” as a result of the Prime Minister’s deal with the Democratic Unionist Party. This, they argue, does not “respect” the “established funding principles and rules applied through the operation of the Barnett formula”.

Had, therefore, Barnett been applied “in the normal way”, then Wales would have received an additional £1.67 billion and Scotland £2.9bn (strangely, they omit to mention that England would receive around £30bn). This, however, either deliberately misunderstands how Barnett works or displays a remarkable level of ignorance for the Scottish and Welsh finance secretaries, the latter of whom is a former professor of social policy at Cardiff University.

But the “normal way” in which Barnett operates is that, as a civil servant put it back in 1978, Scottish expenditure is treated “as a block” and either increases or decreases “in proportion to that agreed for equivalent English programmes”. It does not operate in reverse, so if Scotland, Wales or Northern Ireland receives additional funds, then England gets nothing.

And despite arguments to the contrary, the Tory-DUP deal is not unprecedented. In the 2000s, Wales and Northern Ireland received extra funding to support capital investment or implement EU responsibilities. Even cash in return for votes isn’t new. In 2008, Gordon Brown won a Commons vote on detaining terrorist suspects for 42 days without charge after agreeing to a shopping list of demands from the DUP.

None of these examples involved Barnett, thus Derek Mackay’s letter includes a number of conscious or unconscious red herrings. His argument, for example, that because the £1bn for Northern Ireland will be spent on “devolved matters” then Barnett ought to apply sounds plausible, but only if the English “baseline” was being altered, which it isn’t.

Mackay also rejects the suggestion that recent funding for City Deals is “wrong and not in any way comparable” because it’s conditional upon “match funding” from the devolved administrations. That is true, but it’s still money which, to use the Scottish Government’s own language, “bypasses” Barnett, almost £1bn of direct UK Government spend on Scotland.

Mackay also alludes to the Treasury’s “Statement of Funding Policy”, which encourages the UK and devolved governments to “work together in a spirit of mutual respect, and aim to reach agreement wherever possible”. There is a good argument that the Tory-DUP deal breached at least the spirit of that, but it still has nothing to do with Barnett.

That said, the UK Government’s handling of the whole affair has been woeful. When, a few weeks ago, Westminster-based journalists started framing the DUP negotiations in the context of Barnett (because, frankly, they didn’t understand how it worked), it should have made it explicitly clear that it did not apply. Instead David Mundell bought into that narrative, therefore turbo-charging the Scottish Government’s usual grievance machine.

Setting aside the usual bizarre spectacle of the SNP posing as defenders of a funding system they want to abolish (via independence), there’s also the inescapable fact that Scotland has generally done very well out of Barnett. Before 1999, it habitually received non-Barnett funding boosts, indeed in 1978 a Treasury official complained that the Scots, Welsh and Northern Irish were able to “have it both ways”, automatically receiving increases whenever English departments got more, and also additional cash for special circumstances.

The Scots and Northern Irish, that official added, had played “this game skilfully and effectively”, the Welsh less so. Indeed, if anyone has a genuine grievance about Barnett it’s the Welsh Government, which is probably what lies behind its nationalist posturing over the Tory-DUP deal. Who needs Plaid Cymru when the Welsh Labour Party does the job so well?

Among other Barnett myths and misunderstandings is the belief that it’s somehow a “needs-based” formula. It is not. Rather it is based upon population, although even in 1978, when the current system was first formalised, Scotland’s 10 per cent was more generous than its strict population share vis-à-vis England.

But, as usual, Scottish Nationalists start with a grievance and then work backwards, thus the intellectual contortions in Derek Mackay’s letter. Many otherwise intelligent people have convinced themselves that Scotland has been deprived of cash, despite that assertion being unsupported by either precedent or “normal” practice. And, when the Joint Ministerial Committee inevitably (and rightly) rejects the Scottish and Welsh governments’ complaint, the grievance will be ratcheted up some more.

The SNP should also be careful what it wishes for. By kicking up a stink about the Tories’ “murky” deal with the DUP (even though it wanted its own murky deal back in 2015) and linking it, spuriously, to Barnett, they’re unwittingly shoring up arguments to replace Barnett with a needs-based formula, something the Treasury and many Conservative MPs are itching to do.

The inquiry I alluded to at the beginning of this column recommended precisely that, a “new system” allocating “resources to the devolved administrations based on an explicit assessment of their relative needs”. Devolved governments with “greater needs” (such as Wales), it added, “should receive more funding, per head of population, than those with lesser needs” (ie Scotland).

This, as last week’s House of Lords report acknowledged, would be a “complex task”, but it believes that the prospect of Brexit means reform of Barnett should “be delayed no longer”. Back in 2013, Ruth Davidson referred to the “much-derided and little understood Barnett Formula” being “in its death throes”, it would be a bit bizarre if the SNP, which claims to “stand up for Scotland”, helped kill it off.