There was a ban on foreign investors last year for two full years, but it's mainly a scapegoat. The real problem is realtor facing, with shadow bidding, cheap access to large mortgages, over zealous campaigning of the "Canadian/American dream", and my personal favorite: total lack of rail infrastructure. The GTA does it better than Vancouver, with it's Go Train system et al, but Vancouver is totally cramped with its encircling USA border and mountainous regions. On top of that, with what available land there is, homeowners and city workers petition to prevent construction of new homes. It's NIMBYism at it's finest, allowing homeowners to gladly rake in yearly appreciations at 10-30% while Vancouverites with "generational" down payments of 200-300k out-shadow-bid each other for East Van / Surrey / Coquitlam sloppy seconds.
The silver lining here is remote work. Both Vancouver and Toronto are in dire need of a physical brain drain. Allow remote workers to work from across Canada. The demand for in-city workers will lower and home prices will fall