Accessory Dwelling Units (ADUs) are known by many names: granny flats, in-law units, backyard cottages, secondary units, et. al. Many cities in the San Francisco Bay Area are starting (or already have) loosened up permitting requirements for them. The San Jose and Peninsula counties are hot areas for these. The East Bay county I live in has just changed its policies and now encourages them.
They are not cheap to put up here, because of the cost of labor (even manufactured ones) and land costs. As pointed out, you need to run sewer and utilities, even for an ADU. Still, it can be done for $100K-250K, which is a lot less than buying a house or condo.
My niece is considering putting one on her property for her dad. His home is not elderly-friendly but with a 180-degree view of the San Francisco Bay, Golden Gate Bridge and Bay Bridge, and beautiful Spanish Colonial architecture, the RE profit would easily pay for it - even in a down market.
I think that "betting on RE bubbles collapsing" is akin to timing the stock market. You might be lucky, but again......you might not be. Only you (or a good RE agent) can judge what the past history of your particular area is like.
No matter what the economy, as the saying goes, "they aren't making any more land." 80% of the world's population lives on 20% of the land mass. There is always demand for the coastal areas, for example. It doesn't matter if you're building horizontally (SFHs) or vertically (hi-rises); demand may ebb for a while but simple inflation will rule, sooner or later.