An  alleged £51 million “blunder” by the taxman that has been blamed for the downfall of Rangers could result in legal action.

HM Revenue and Customs’ initial £94m claim on the Ibrox club’s old operating company could be cut to £43m if the liquidator BDO succeeds in a fight to contest the way the taxman calculated what the club owed over its controversial use of employee benefit trusts (EBTs) to pay staff and players.

The Herald understands the BDO case could end up being resolved in court.

While Rangers made no comment on the development, unconfirmed reports suggest the current owners are considering legal action.

It is understood that the club intends to undertake a forensic examination of tax and company law in respect of any recalculation and its impact.

The taxman had said around £74m was owed for the club’s use of EBTs from 2001 to 2010 to pay players and staff as part of the overall tax claim.

That came after the club’s business fell into insolvency over non-payment of tax of £14m by the old Craig Whyte-run Rangers FC, which relegated the club to the third tier of Scottish football.

Instead of being paid a salary that would be subject to income tax and national insurance, staff under EBT schemes were loaned money – but courts have decided that these payments were wages.

The BDO accountancy firm say the accounts and the taxman have reached an agreement to withdraw a £24m penalty in relation to the EBT claim.

But BDO are said to be about to challenge HMRC’s calculation that the rest of the £38m, plus £12m interest, was wrongly subject to what is called “grossing up” in terms of working out tax. This sees the amounts paid to players as net pay. An HMRC calculation would add the higher rate of tax, 40%, plus national insurance to the payment to work out the total owed.

It is understood that the liquidator believes this to be wrong, and that a recalculation would see the actual amount owed from the so-called “EBT Big Tax Case” cut to just £23m, with interest of £12m also being cut.

Tax barrister, Jolyon Maugham, QC, said: “Lots of noise about HMRC and Rangers. But this seems to be the nub of the story. Rangers seems to have persuaded HMRC its tax conduct wasn’t sufficiently culpable to attract a penalty.

“But HMRC doesn’t seem to accept that it assessed Rangers to the wrong amount.”

Asked if he believed HMRC would be liable to pay compensation as a result of their original miscalculation, Mr Maugham replied: “I’m not sure it is even theoretically possible to sue HMRC. But it would take an awful lot more than getting the number wrong.”

The Herald understands that the issue only came to light after the taxman started sending out the full EBT tax assessments.

It is also believed that BDO and HMRC are yet to start negotiations on how this “blunder” happened and bring the value of their claim down.

If the negotiations fail to reach agreement, it is believed it could go to mediation and then ultimately the law courts.

Executives in charge of Rangers before it was sold by Sir David Murray believe that the size of the potential EBT debt had put off potential buyers of the club – paving the way for a sale for £1 to Mr Whyte in May 2011 and the financial collapse nine months later.

At the time, executives feared a “nuclear missile” £50m bill if they were landed with the EBT bill and were so worried that they took advice.

Stephen Outhwaite, a former senior tax inspector specialising in investigation and regulatory issues, said that “grossing up” should not have been applied to staff and players, and should only apply to directors if they are unable to make good the income tax paid by the company.

It was thought a total of 111 sub-trusts were set up between 2001-2010 for Rangers directors, players and other staff – along with employees of Murray International Holdings and its subsidiary companies. A total of 53 Rangers players and staff received side contracts giving undertakings to fund their sub-trusts with cash, it is understood.

Fans have criticised the development. Former club director Chris Graham said: “No chance this was a mistake. Throughout this entire saga those with agendas have shown themselves to be willing to set aside any professional ethics they ever possessed.”

A BDO spokesman said that, since June, tax specialists have been negotiating with HMRC over the size of the tax bill.

“There is no final decision. Negotiations are ongoing and we expect a resolution of this in 2020,” said the spokesman.

An HMRC spokesman said: “We don’t comment on identifiable businesses. HMRC has always been clear that disguised remuneration is a form of tax avoidance.”