Wouldn’t wfh decrease the cost of living in the city, since currently most high paying jobs make living within commuting distance a requirement? To make an extreme example, cost of living on the Bay Area should go down if wfh becomes widespread. There are other reasons to want to live in SF aside from getting paid a high salary in tech, so housing prices should “fallback” to whatever people value the culture/scenery… at. What you would probably see is a more even (and healthy) distribution of growth in all metro areas instead of being centered in a few with all of the cost of living increases associated with that.
I'm not sure SF is a great example. For most tech workers, they're giving themselves a worse commute by living in the city rather than somewhere else in the South Bay closer, in many/most cases, to where their office is. So, yes, their jobs may be a major reason they're in the Bay Area overall, but mostly not in SF itself.
This is of course much less true in industries like finance.