Yes, if you have 500 000 people in town, you need to produce food for 500 000 people all the time. While if you have 500 000 people in town, you only need to build houses for 500 000 once.
Unless, of course, some people who already have a house or people who do not even live in your town can buy houses in your town in order to use them as investment and/or to rent them to people living in your town. Thankfully, this is a completely ridiculous counterfactual and noone ever does that...
But the logic of “there is a shortage of X, therefore the proper solution is to ban the production of X and hope that the problem will magically go away” is insane either way.
For some things this logic is valid. See induced demand and attempts to solve traffic jams by building even larger roads. Now housing isn’t exactly like that, but neither its like food. This kind of appeals to simplified heuristics and resulting referent class tennis is non-productive.
Thankfully rising land prices due to agglomeration effect is not a thing and the number of people in town is constant...
Don’t get me wrong, building more housing is good, actually. But it’s going to be only marginal improvement, without addressing the systemic issues with land capturing a huge share of economic gains, renting economy and real-estate speculators. These issues are not solvable without a substantial Land Value Tax.