If labour and material costs are also high that increases the value of houses that are pre-existing. It means the buyer does not have to pay extra for and wait for a house to be built, which has some value. Also, there's a certain tolerance that I'm sure many people, if I may project, have for how crappy of quality a house actually is. They just want a damn place to live and call their own. Especially when the market is not in the buyer's favour.
At least that's how it all seems in Toronto. In the city of Toronto proper, a detached house selling around $1,000,000 is almost guaranteed to be of relatively bad quality right now.