At first sight, Theresa May and Donald Trump could hardly differ more in aspect, behaviour, demeanour and dignity. But what they share is an almost total lack of reasoning power and an ability to hold on to multiple contradictions by the sheer act of will.

The daily Brexit impasse of impossibilities has been May’s hallmark, but this week’s revelation on migrant visas reminds us of the full florid extent of her unreasoning. Over 6,000 highly skilled people from outside the EU were turned away between December 2017 and March this year, all highly qualified people urgently needed to fill waiting jobs: their prospective employers in the NHS, universities and industry are distraught. The Campaign for Science and Engineering has uncovered figures for those refused visas, using freedom of information requests: easy to see why the government stopped publishing figures last December.

Theresa May 'blocking requests' to allow in more overseas doctors for NHS Read more

As home secretary, Theresa May introduced an irrational, random cap of 1,600 tier 2 skilled visas a month, regardless of how urgently skills are needed. Start with the NHS, in obvious crisis, where 100,000 posts are unfilled. Why bar 1,518 doctors? Brexit is causing what the Royal College of Nursing calls a haemorrhage of nurses; more are leaving than joining, with new arrivals denied visas. Whatever your view of intractable anti-immigration politics, I can find no pollster who finds the public against recruiting doctors and other highly skilled people to add to the UK talent pool. This is a bee in May’s bonnet alone. What is she thinking?

Her visa cap inflicts maximum harm in engineering, IT and all the industries Brexiters claim we will sell around the world. Recruitment to high-powered jobs of people from outside the EU is rising sharply, because the Brexit vote is deterring EU applicants.

Take just one example: the world-renowned Wellcome Sanger Institute claims visa problems have delayed important research at the institute. “Genomics is a sector vital for the delivery of the government’s industrial strategy,” says its associate director Dr Julia Wilson. The president of the Royal Society, Prof Venki Ramakrishnan, says the restrictions hold Britain back, especially in computing where “for the foreseeable future we are going to need to recruit IT professionals from overseas” protesting at “random immigration limits plucked out of the air for political purposes”.

Between December and March, 1,226 IT specialists and 392 engineers were denied visas to take up offered jobs, along with 1,879 healthcare professionals, 197 teachers and 572 other professions. The Institution of Chemical Engineers director, Andy Furlong, says: “Chemical engineering is a global activity, which relies on free trade and the free movement of talent.” Visa refusals “create blockages in the talent pipeline, which stifle innovation, collaboration and productivity”.

May’s implacable perversity was well observed by cabinet colleagues when she was home secretary. However hard they tried to reason with her, they always failed. They begged her to take students out of overall migration figures: it would bring down the headline figures, as they are not migrants but return home after graduating – and they bring funds for universities as well as vital future close relationships with wealthy trading nations. But nothing shifted her– even her prime minister couldn’t prevail. Why? No one knows. No opinion polling suggested these are the foreigners that concerned Brexit voters.

Her approach to Brexit is similarly impossibilist: looking back, historians will wonder how serious politicians and civil servants sat by and watched nonsense in action. Beyond absurd is setting her cabinet to debate two customs options, both of which are non-starters with the EU, whose negotiators look on in astonished dismay as she continues to pursue contradictions – frictionless borders with no hard border in Northern Ireland, no border in the sea and no customs union.

Skilled migrants protest against UK visa policies Read more

We are all used to prime ministers with whom we passionately disagree. But I think this is the first time I have seriously doubted the logical reasoning power of our national leader. There is something impenetrably strange about this prime minister’s brain. We are used to populist leaders caving in to public urges or Daily Mail front pages. But neither apply to the visa issue. Nor can denying entry to the highly skilled be any kind of personal ideology.

If she had a genuine passion for up-skilling our own population, where is the deluge of funding for that? Instead, ladders upwards are cut. If there is no rational explanation, then the fear is that we are being led by sheer unreason, “because I say so, because I never change my mind”, like the worst teachers who lack real authority so resort to mindless obduracy instead.

No wonder no Brexit progress has been made in two years. The stiff vicar’s daughter is of a different species to Trump’s flamboyantly bombastic vanity. But inside their brains they may share the same levels of nonsensical unreason that make them both a risk to their countries.

• Polly Toynbee is a Guardian columnist