Bankruptcy. If the market-clearing rent for an area drops below what the developer needs to pay the interest on the construction costs, it doesn't just sit idle (if it does, the developer just goes bankrupt
faster). Rather, the developer goes bankrupt, he and the bank both take a haircut, and the property gets sold to a new owner at whatever price the new market-clearing rent can support. The new owner then makes a profit renting at reduced market rates.
This happens periodically in the Bay Area - it happened on a large scale in both 2001 and 2009. It's the best time both to make a real estate investment (folks who bought housing in 2010 are sitting pretty now; I'm kicking myself for not) and to be a renter (I rented a lovely apartment for $1400/month for 3 years in 09-11 that had gone for > $2000 in 2007, and is at about $2800 now).