George Osborne budget
George Osborne and his Treasury team delivering the 2015 budget Reuters

After their pathetic performance in the years before the onset of the banking crisis, those ratings agencies have yet, in my opinion, to regain their own credit rating.

Nevertheless, I uttered three cheers at the end of last week when I learnt they are casting doubt on the UK's ability to maintain its top rating. The doubts have arisen in the face of the prospect of the referendum on our continued membership of the European Union – the so-called Brexit.

Something was needed to wipe the smug smile off Chancellor George Osborne's face and this item of news was as good as any. For the trouble is that the outcome of the recent British general election has gone to Osborne's head. It matters not that it was a case more of Labour losing the election than the Conservatives winning (with a mere 37% of votes cast). The chancellor now thinks he has received a resounding vote of confidence in his austerity policies.

Now, regular readers will know I differ from Standard & Poor's (S&P) when it comes to its worries about financing the UK's budget deficit. The fact of the matter is that, for all the scare stories, this country has had no difficultly with the budget deficit. The real problem is the balance of payments deficit, already running at 5.5% of gross domestic product, and likely to look a lot worse if we lose the trading privileges of belonging to the European Union.

George Osborne
George Osborne has announced the government will sell its £1.5bn share in Royal Mail as part of his savings plan Getty

It cannot be repeated too often that in the face of the great recession that followed the 2007-08 financial crisis, deficit financing was not the problem: it was the solution.

This was not just for the UK, although Gordon Brown as a British prime minister with worldwide contacts played a major role in "saving the world". The essential components were the bank rescues of late 2008 and the Group of Twenty fiscal stimulus agreed at their London meeting in April 2009.

Alas, having done the right thing and learned the lesson of the mistaken policies of the late 1920s and early 1930s, the G20 at its Toronto meeting in summer 2010 changed tack before the recovery was sufficiently established and embarked on wholly inappropriate policies of austerity, with Britain's new chancellor Osborne acting as a cheerleader.

Now, budget deficits tend to disappear fast when economies experience reasonable economic growth. Unfortunately, for all the crowing about the latter period, the UK did not experience reasonable economic growth once the government had embarked on its programme of austerity. Indeed, we have undergone the slowest economic recovery on record.

In referring to the deficit on trade, S&P is on to something. There was a burgeoning problem with the balance of payments in 2010, but it has got a lot worse since then. Put bluntly, economic growth in general, and industrial production in particular, is heavily dependent on investment.

Alas, the UK's record on both public and private sector investment since 2010 has been abysmal. This has had a deleterious impact on industrial capacity and exports, with the result we see in the balance of payments position.

It can be seen that in weakly bowing to Ukip pressure for an EU referendum, the government of David Cameron and Osborne has opened up a can of worms. Whereas during the 1975 referendum campaign the Conservative Party in Parliament was divided into eurosceptics and europhiles, it now seems to consist almost entirely of eurosceptics, with up to a third wishing to leave the EU altogether.

This is the kind of scenario that appears to have aroused the concerns of S&P. Doubtless such fears will spread, as it finally dawns on the financial markets that Osborne has been concentrating on the wrong issues.

William Keegan is a journalist, academic, and the senior economics commentator at The Observer. He has published his latest work – Mr Osborne's Economic Experiment - Austerity 1945-51 and 2010 (published by Searching Finance) – which can be purchased on Amazon.