Sidharth Vijay couldn’t afford to celebrate the first birthday of his youngest daughter this year: he couldn’t buy the UK-born child even the smallest present. Earlier this week, when the sun was shining, he didn’t have enough money to buy either of his children an ice-cream.

Vijay (not his real name) is a specialist computer programmer, a profession on the government’s list of shortage occupations. Since his arrival in the UK in 2011, he has never earned less than £50,000 or worked fewer than two jobs; he has been employed full-time by companies including Toshiba while running his own IT consultancy company.

Since September 2017, however, Vijay has been forbidden by the government to work because of a legal tax amendment he made to his records in 2014. Having spent about £15,000 in legal costs and Home Office fees, he is now close to destitution.

“We’re barely surviving,” he said. “I can barely take care of the basic needs of my wife and children. My older daughter was in her school playground recently with children playing with Lego. I had the humiliation of hearing her tell them how much she loves Lego but can’t have any, because I don’t have the money to buy them any toys. It tore me apart.”

Vijay’s case is significant because he amended his tax returns within the 12-month period which the HM Revenue & Customs states in its own manual is the right of every taxpayer. Despite his amendment being made in time, however, he has been refused indefinite leave to remain (ILR) by the Home Office under paragraph 322(5) of immigration law.

“The Home Office has overridden the legal right granted to me by the HMRC, by using my in-time amendment to deport me under a rule designed to tackle criminals and those judged to be a threat to national security,” he said.

The controversial paragraph 322(5) comes with devastating conditions. Applicants immediately become ineligible for any other UK visa and are banned from returning to the UK for 10 years. Many are given just 14 days to leave the UK with their families after having lived here for decades, while others are allowed to stay and fight their cases but not to work, rent or use the NHS.

In addition, people deported under the terrorism-associated paragraph will have that permanently marked on their passports, making it highly unlikely they will ever get a visa to visit or work anywhere else in the world.

The Home Office’s own internal guidance to caseworkers specifies that section 322(5) should only be triggered in cases involving “criminality, a threat to national security, war crimes or travel bans”. But the discretionary section allows the Home Office to refuse an applicant by inferring that their “character and conduct” make them undesirable to be allowed to live in the UK.

In 2014, Vijay was sent a 2012-13 tax calculation by HMRC. Realising it contained an accounting error which meant he owed the tax authority about £4,000, he contacted them and paid the sum. This was done within the window which the HMRC says it allows in its self-assessment manual: “Just as HMRC has the right to repair an obvious error or mistake on the return, the taxpayer has the right to amend it, within 12 months of the statutory filing date,” the manual states.

Vijay was, however, anxious about the amendment and wrote to HMRC. In its response of April 2018, it replied: “I can confirm that you made amendment to your 2012-13 return within the 12-month window that HMRC requires, and that you followed HMRC guidelines, so HMRC wouldn’t charge you any penalties, also all payments were received on time, so again no penalties would have become due.”

Vijay said:“If parliamentary legislation grants me a right and the HMRC – which is a statutory body – honours it, then isn’t it true and obvious that Home office should acknowledge and abide by it too?”

Vijay also queries the legality of the Home Office’s use of paragraph 322(5) in his case. “If you look at the immigration directorate instructions, it clearly says that ‘a person may be refused under this paragraph if it seems right to do so for the public good’,” he said. “It goes on to clearly equate the public good with national security, to highlight that the offence has to be of that severity. How is using my legal right to complete an in-time tax return an offence on a par with being a threat to national security?”

To try to make sense of his refusal, Vijay applied for his caseworker notes. Seen by the Guardian, these show he was found to be “credible” and that his refusal in February 2018 under 322(5) was entirely triggered by figures obtained from the SA02 tax documents submitted by the applicant.

But Vijay said he had never submitted a SA02 document. He could not have because SA02 forms are only issued when a tax amendment has been made late, which his was not.

Vijay contacted the HMRC to be certain that he had not made an error and received a letter, which stated: “I can confirm, as discussed today, there has been no out-of-time adjustment to any of your previous years liabilities and therefore no issue of a SA02 at any point.”

Vijay is also perturbed by a letter from the Home Office, from August 2017, which refers to an interview they state he attended and again refers him giving them an SA02 form. “I never attended an interview with the Home Office,” he said.

“In a couple of months, I will be forced to either sell the house or bank will repossess it. My life has been completely destroyed. Every time I try to sleep, the bleak future of my children flash in front of me.”