This may not do much for the blood pressure of anyone currently stuck on an NHS waiting list. But in the past six months more than 2,300 foreign doctors who would otherwise be filling vacancies on British wards have been refused visas to come here, according to figures released following a freedom of information request.

To be clear, these are doctors hospitals wanted to hire, but couldn’t. They can’t in large part because a government running scared of anti-immigrant sentiment set an arbitrary target eight years ago to reduce immigration, and capped the number of skilled workers coming into Britain in order to help meet it. If the Windrush scandal was one grimly foreseeable consequence of that target, here potentially is another one: not wrongly threatening to send people back, but refusing to let in people we actually need. Think of it as cutting off your nose to spite your face, then wondering why it seems so hard to smell anything now.

The rumour is that Theresa May may finally be bowing to pressure from the health secretary, Jeremy Hunt, and the new home secretary, Sajid Javid, to relax the cap, at least for the NHS. But that’s a temporary fix to a much larger structural problem, which is that reducing immigration comes at a cost, no matter how many voters wish it didn’t. And with only nine months left until we leave the EU, parliament still hasn’t got close to tackling the one issue millions of leavers actually cared about: squaring their passionate desire for fewer foreigners to be working here after Brexit with an equally passionate desire for care homes to be staffed, farm crops to be picked, and the doctor to see you now.

Inevitably, some of the hospitals worst hit by visa issues will be those with the neediest patients. They will be the ones operating in struggling communities with deep-rooted social problems, or the ones demoralised by past scandals: places that have always struggled to recruit, because British doctors aren’t keen to work there. Ironically, many will serve communities that backed Brexit, partly in the hope of keeping immigrants out and partly in the belief that leaving the EU would help the NHS, just like it said on the bus.

Eastern European doctors are indeed now more reluctant to come, but homegrown replacements take years to train – which is why hospitals are looking outside the EU, only to fall foul of Home Office rules capping so-called tier 2 visas (the kind covering skilled workers, including doctors) at 20,700 a year.

Consultants have a reasonable chance of getting though, because priority is given to workers earning over £50,000 a year. But junior doctors on lower salaries don’t, even if it’s junior doctors that many hospitals actually need. And navigating all this is costing money that hospitals haven’t got, as the Grimsby MP Melanie Onn pointed out last week. Her local trust is spending £50,000 a month processing visas, 85% of which are then refused. Similar problems are increasingly affecting other industries seeking to hire overseas staff with hotly sought-after skills that take years to acquire, such as IT specialists, scientists or engineers.

Solving this dilemma is easy for liberal leavers, the sort who are insist that for them it was really all about sovereignty. They always said Brexit meant controlling, not closing, Britain’s borders, that it could actually mean more rather than fewer opportunities for economic migrants from outside the EU – especially if more foreign worker visas turns out to be the price of a good trade deal with India, for example.

But that’s not quite how Brexit was sold to voters in Middlesbrough, Sunderland and Grimsby – and it’s not compatible with a policy capping skilled workers either. It’s astonishing, really, that two years after a referendum so driven by feelings about immigration we have barely scratched the surface of this argument; that voters should have no idea what will happen to immigration when we leave. Today’s Brexit votes in the House of Commons, crucial as they are, may turn out to have been the easy bit.

• Gaby Hinsliff is a Guardian columnist