An attempt to overturn a key pillar of the government’s hostile environment policy that forces landlords to evict or turn away tenants they believe may be in the country illegally is due to begin in the high court.

Campaigners and landlords won leave this year to bring a judicial review against the Home Office on the grounds that the so-called Right to Rent scheme is unlawful and discriminates against tenants on the basis of their race or nationality.

The Joint Council for the Welfare of Immigrants (JCWI), the charity that has brought the appeal along with the Residential Landlords Association (RLA), the Equality and Human Rights Commission, and Liberty, said the policy put people who had a legal right to be in the UK at risk of homelessness and destitution.

Since 2014 landlords have been required to assess whether prospective tenants are in the UK legitimately. In 2016 an offence was introduced of knowingly leasing a property to a disqualified person, with landlords facing hefty fines or a maximum prison sentence of five years if they fail to evict the tenant.

The Windrush scandal revealed the extent to which citizens with Caribbean backgrounds who had lived in Britain for decades were being wrongly evicted, prevented from working and denied NHS treatment after being unable to provide the right documentation.

The RLA published research on Monday showing that nearly half of private landlords were less likely to rent to people without a UK passport, in part because of “fear of getting things wrong” and being penalised. A fifth of landlords said they were less likely to consider letting to EU nationals because of Brexit uncertainty.

The association, which represents about 50,000 private landlords letting 250,000 properties, has said Right to Rent in effect turns its members into untrained border police and discriminates against tenants.

In a report published in March, the independent chief inspector of borders and immigration, David Bolt, concluded that Right to Rent had “yet to demonstrate its worth as a tool to encourage immigration compliance” and that the Home Office was failing to effectively monitor its use.

The court will also hear the case of a woman, Kate Goloshvili, who was wrongly denied the right to rent, a ruling that put her life on hold for 10 years, after the Home Office lost her passport when she tried to renew a student visa. She was unable to work legally or rent property, was forced to give up a university degree and suffered from depression.

The Home Office admitted this year that Goloshvili, who is represented by Camden community law centre, had wrongly been treated as an illegal immigrant for a decade and had always had leave to remain.

David Smith, the policy director of the RLA, said: “The Right to Rent is creating a hostile environment for those who are legitimately in the UK but may have documentation that is not easy to understand for landlords.”

He said landlords could not be blamed for taking a cautious approach as they were not immigration officers. “It is a policy that clearly leads to discrimination against certain groups and needs to be brought to an end.”

Chai Patel, the legal policy director of the JCWI, said: “Sajid Javid [the home secretary] promised he would learn the lessons of the Windrush scandal, which left many thousands of legal immigrants to the UK destitute, detained and even deported. But he is ignoring the clear evidence, further reinforced by today’s new RLA findings, that requiring landlords to check immigration status does not work and causes exactly the kinds of problems that the Windrush generation faced.

“Not only is he ignoring our evidence, he is fighting us in court to stop the Home Office from being required to do its own evaluation into whether the scheme is harming ethnic minorities and foreign nationals with every right to rent property.”

The Home Office said: “It would be inappropriate to comment on ongoing legal proceedings.”