When UK civil servants drew up plans for this week’s summit of Commonwealth leaders in London and Windsor, their themes included “a fairer future, promoting the principles enshrined in the Commonwealth charter of democracy, good governance, human rights and the rule of law”. Oh dear.

What was supposed to the biggest and best international conference held in Britain turned into a presentational disaster. Worse still, one created by Theresa May.

The heart-rending stories of people in the Windrush generation invited to the UK in the 1950s and 1960s, who have lost jobs and NHS treatment and faced deportation, can be traced back to the “hostile environment” strategy May pursued as Home Secretary. True, it was aimed at illegal immigrants. But it created a presumption that people were here wrongly unless they could prove otherwise, so those with every right to stay were scandalously treated as illegals.

It is no use ministers blaming civil servants. As Margaret Thatcher said: “Advisers advise and ministers decide.” Lucy Moreton, general secretary of the ISU union representing immigration staff and a former chief immigration officer at Heathrow airport, said it was “deeply unfair” to blame officials acting on instructions from their political masters. She told BBC Radio 4’s Today programme that officials’ discretion to take an “educated and sensible view” in individual cases was removed after May sacked Brodie Clark as head of the UK Border Force in 2011 for relaxing passport checks to ease airport queues. (Clark claimed he was made a scapegoat.)

Windrush generation: threat of deportation from UK Show all 15 1 /15 Windrush generation: threat of deportation from UK Windrush generation: threat of deportation from UK The ex-troopship 'Empire Windrush' arriving at Tilbury Docks from Jamaica, with 482 Jamaicans on board, emigrating to Britain. Getty Windrush generation: threat of deportation from UK Jamaican immigrants being welcomed by RAF officials from the Colonial Office after the ex-troopship 'Empire Windrush' landed them at Tilbury. PA Windrush generation: threat of deportation from UK Alford Gardner who arrived in Britain in 1948 on the first Windrush ship to dock in Tilbury, Essex, speaking at his home in Leeds PA Windrush generation: threat of deportation from UK Alford Gardner in Leeds shortly after he arrived in Britain in 1948 on the first Windrush ship to dock in Tilbury, Essex PA Windrush generation: threat of deportation from UK Gardner was 22 years old when he boarded the ship in Kingston, Jamaica, with his brother Gladstone before they and hundreds of Caribbean migrants called on to rebuild post-war Britain disembarked the ship in Tilbury Docks PA Windrush generation: threat of deportation from UK Alford Gardner (right), during his RAF service in 1947 PA Windrush generation: threat of deportation from UK The son of Ruth Williams, a Windrush-generation immigrant, wants to the leave the country after threats of deportation. According to his mother, Mr Haynes applied for British citizenship in 2016 but was rejected, despite Ms Williams having lived in the UK almost permanently since arriving from St Vincent and the Grenadines in 1959. Ruth Williams, 75, said she felt "betrayed" by Britain after the Home Office twice turned down applications for her 35-year-old son, Mozi Haynes, to remain in the country. Ms Williams is understood to have cancer and said she relies heavily on her son for support. PA Windrush generation: threat of deportation from UK The British liner 'Empire Windrush' at port in 1954. Getty Windrush generation: threat of deportation from UK Ruth Williams, 75, with her British passport. "I feel betrayed and a second class citizen in my own country," she said. "This makes me so sad and the Home Office must show some compassion. "I am unwell and almost 75, I live on my own and I need my son to stay here. I need my family around me and I can’t face being alone. He has applied to the Home Office and been refused twice." PA Windrush generation: threat of deportation from UK From the top, hopeful Jamaican boxers Charles Smith, Ten Ansel, Essi Reid, John Hazel, Boy Solas and manager Mortimer Martin arrive at Tilbury on the Empire Windrush in the hope of finding work in Britain. Getty Windrush generation: threat of deportation from UK Jamaicans reading a newspaper whilst on board the ex-troopship 'Empire Windrush' bound for Tilbury docks in Essex. Getty Windrush generation: threat of deportation from UK After half a century in Britain, Anthony Bryan decided it was time to go abroad. But the decision set off a nightmare that saw him lose his job, detained twice and almost deported to Jamaica. AFP/Getty Windrush generation: threat of deportation from UK Jamaica-born Anthony Bryan poses outside his home in Edmonton, north London. Now 60 and a grandfather, Bryan thought the issue could be resolved swiftly, as he legally moved to Britain with his family as part of the Windrush generation of Caribbean migrants after World War II. In 1948, the ship Windrush brought the first group of migrants from the West Indies to help rebuild post-war Britain, and many others followed from around the Commonwealth. A 1971 law gave them indefinite leave to remain, but many never formalised their status, often because they were children who came over on their parents' passports and then never applied for their own. AFP/Getty Windrush generation: threat of deportation from UK Three Jamaican immigrants (left to right) John Hazel, a 21-year-old boxer, Harold Wilmot, 32, and John Richards, a 22-year-old carpenter, arriving at Tilbury on board the ex-troopship 'Empire Windrush', smartly dressed in zoot suits and trilby hats. Getty Windrush generation: threat of deportation from UK Newly arrived Jamaican immigrants on board the 'Empire Windrush' at Tilbury in 1948. Getty

May’s approach was also a result of the target to reduce net migration below 100,000 a year, a figure the Conservatives plucked out of thin air in 2010. It meant the Home Office scrabbled around for every device to chip away at the numbers – even though the Tories’ Liberal Democrat coalition partners warned them the target was unachievable. While removing illegals would not help meet the target, the climate meant those entitled to be in the UK were caught in the net because of the colour of their skin. I’m not saying it was deliberately racist. But it was an unintended consequence of May’s strategy. How ironic, coming from the politician who admitted in 2002 that the Tories were seen as “the nasty party”.

The Windrush scandal, which shames the UK, may yet have a silver lining. It could strengthen the hand of ministers, led by Amber Rudd, the home secretary, trying to steer the Tories towards a more liberal immigration policy. She is warming to the idea of issuing an annual report on migration, which has been proposed by the Home Affairs Select Committee as a way to build consensus, tackle myths and spell out the cost and benefits of immigration at local and national level.

Rudd will likely win her battle to remove overseas students from the migration figures; May is isolated in her own cabinet on that. The same is true of the discredited target, which should now be killed off once and for all.

Rudd wants business to continue to have access to EU migrants after Brexit, while Eurosceptic ministers will oppose preferential access for the EU. But even they are striking a more positive tone. Michael Gove declared that Britain now has “the most liberal attitude towards migration of any European country”. (I think he forgot Germany, which has accepted an estimated 600,000 Syrian refugees to Britain’s 10,500.) Boris Johnson said that “one of the myths” of the referendum decision was that it was about slashing immigration. (I must have imagined those Leave campaign warnings about 5.2 million people arriving in the UK from Turkey and Balkan states when they joined the EU.)

'They were going to send me back to Jamaica. I’ve never been to Jamaica': Son of Windrush immigrant threatened with deportation

While we should welcome a change of heart by the Tories on immigration, it is not coming for entirely altruistic reasons. It is dawning on them that they will struggle to win an election as their elderly supporters literally die out if they fail to appeal to a younger generation more relaxed about immigration.

Appropriately, such a warning has just been delivered by Tory peer Lord Cooper of Windrush – the Cotswolds river which provided the name for the Empire Windrush, the ship which brought the first group of Caribbean migrants to the UK 70 years ago. “Since the Brexit referendum the Conservative Party has too often looked at sounded like an English Nationalist movement,” he wrote in a report for the British Future think tank marking today’s 50th anniversary of Enoch Powell’s “rivers of blood” speech.

Cooper, who co-founded the pollster Populus and was David Cameron’s director of strategy in Downing Street, pointed out that the Tories lost ground among non-white voters last year for the second election running. The party holds only one seat with a BAME population of more than 30 per cent; by the next election, there will be more than 120 such constituencies. “Unless something changes, before long there just won’t be enough white voters for the Conservative Party to be able to win,” he said.