Zoning is the same way. Some of the rules are critical, but most are existing residents enforcing their preferences via bylaw. Ensuring adequate buffers between truly industrial uses and residential is a great use of zoning. Not being able to open low impact business like a barber shop or cafe in a residential neighbourhood makes absolutely no sense. Lot coverage percentages, parking minimums, height restrictions that don't allow gentle density, and exclusive single family zoning all need to go.
More than a century of code and zoning restriction have piled on each other over and over (with zoning often deeply rooted in racist policies). It's long past time to identify the safety critical ones and eject all the rest. It's true of zoning moreso than building code, but both could use a serious refactor.