Family homes and family apartments are not the same thing. You are referring to zoning restrictions only allowing detached single family homes to be built, which are more expensive per occupant, and hence keep poorer people away.
There are multiple reasons for why dense areas only have 1 and 2 bedroom apartments, while less dense areas only have detached single family homes. One is, as you say, to keep the poorer people away. But another big one is also the change in household size due to people's preferences. And yet another is people's preference for detached single family homes once they do have kids (by and large).
So, to repeat myself, no. There is an overabundance of 3-4 bedroom homes in dense urban centers and we continue to build too many of these. There is a shortage of 0-1 bedroom apartment in dense urban centers.
I should've been clearer, I meant development of new abodes is bifurcated, it's either a low density region with homes with multiple bedrooms, or a high density region with homes with 1 or 2 bedrooms.
The 3-4 bedroom homes in dense urban centers were probably built a while ago, but I have never seen new homes built in dense urban centers (I'm referring to NYC/SF/SEA/etc). The low density suburb regions that border the dense urban center usually try to keep their low density status.
You won't see an apartment building with units that have 3 and 4 bedrooms going up in Manhattan, and you won't see apartment buildings with 1-2 bedrooms going up in the Silicon Valley suburbs.
That's not really the case, though. We don't have detailed statistics for bedroom count in New York because a city of just 8 million people with the largest urban economy on the continent can't be expected to track building permits. However in my city, Berkeley, California, the densest city in California outside San Francisco, we get mostly larger apartments. For example I point to the nearly-completed 2587 Telegraph Avenue with 485 bedrooms across 4, 5, and 6-bedroom apartments but only 5 studios. This is a direct outcome of the zoning code that denominates "density" in terms of units, therefore incentivizing the construction of gigantic units with too many bedrooms and forcing people into roomate situations that they don't actually want.
There are multiple reasons for why dense areas only have 1 and 2 bedroom apartments, while less dense areas only have detached single family homes. One is, as you say, to keep the poorer people away. But another big one is also the change in household size due to people's preferences. And yet another is people's preference for detached single family homes once they do have kids (by and large).