This is what banks are for. Real estate is essentially their bread and butter. It’s a physical, valuable asset that they can seize and auction off.
We’re also talking about houses (stand-alone units) rather than housing. These developers aren’t fronting the cost to build individual homes. That’s all covered by home owners (via a construction loan)