“New Zealand bans sales of homes to [many] foreigners”

It can be done.

“New Zealand’s parliament has banned many foreigners from buying existing homes in the country – a move aimed at making properties more affordable.

The ban only applies to non-residents. Australians and Singaporeans are exempt because of free-trade deals.

New Zealand is facing a housing affordability crisis which has left home ownership out of reach for many.

Low interest rates, limited housing stock and immigration have driven up prices in recent years.

Is it a total ban?

No, only non-residents are affected by the Overseas Investment Amendment Bill, which was passed in a 63-57 vote on Wednesday.

They are now banned from purchasing most types of homes – but they will be able to make limited investments in new apartments in large developments.
Foreigners with residency status in New Zealand – as well as non-resident Australian and Singaporean nationals – are not affected by the ban….”

https://www.bbc.co.uk/news/world-asia-45199034