If you're talking about CA's state laws, you're right that they supersede local laws. You'll notice that I used the word "should" in my comment, indicating a normative view. I think CA's state legislators have passed many laws that were unwise, including several that voters have had to undo via constitutional amendments.
While I would place state laws passed by popular vote above local laws passed by popular vote, I would say that laws passed by representatives, without much awareness of voters that this was their intention, should not necessarily be put above local laws passed by voters themselves.
A Reddit-style reply feels apropos here: "That's just like...your opinion man."
And in this case "local laws passed by voters themselves" are one of the causes of the state's housing crisis. I think the state has a legitimate interest in overriding local laws here.
Like if you don't want high density in your neighborhood, buy all the houses. Form a neighborhood association and buy every house that's put up for sale. When selling properties, include covenants restricting resale to a developer, or giving the association first right of refusal. Spend your own money. Don't use state violence to achieve private ends.
Is it wrong? If I try to build an apartment building on land I legally own in violation of a zoning law voted in before I was born, by people who never paid a cent for my land, the sheriffs department pays me a visit.
And that would be totally unfair if the law was kept secret, and then sprung on unsuspecting property owners.
But we all know that's not the case. Prospective purchasers are well aware of zoning laws. Same reason you can't build a fuel refinery on your tidy plot of R1 land. It would put existing owners, who have a reliance interest in existing zoning laws being respected, in an awfully unfair position.