Commercial regulations are an interesting beast.
Ostensibly, they exist to improve the functioning of the market. For example, in the US packaged food is required to have nutrition information labels so that customers can distinguish different products nutritionally. And this can be very valuable. If you're on a low salt diet, it's important to be able to find the canned green beans that actually have less salt in them.
Unfortunately, they have a bunch of other effects as well. They create barriers to market entry. If you want to sell packaged food, you have to make sure every package has identical contents and then have those contents lab tested to determine the exact nutritional ratios. This means very tight manufacturing tolerances, and mean that any packaged food that says "homemade" on it is lying - unless someone has a food production factory in their house. Packaged food that isn't manufactured on a very precise assembly line is illegal. This may not be a bad thing - we expect packaged food to be consistent - but it's a thing.
And, as we see in the Tesla situation, it locks in established business models. There's no specific benefit to the consumer from the exact model of car sales we have compared to any of the other possibilities. But everyone used that model, so it became mandated by regulation in some places.
The problem comes when you take into account the way regulations get made. Regulations (and laws) are proposed by people who want some new policy enforced. Then they're evaluated based on the input of experts and stakeholders. In practice, "experts and stakeholders" means paid lobbyists, because nobody else has the time to show up for a hearing on how cars are sold, how food is packaged, or whether there should be a tariff on sugar.
The study of how this works is a branch of economics called public choice theory. Spoiler: The public interest is not the primary driver of regulation. Regulations where the benefit to existing producers from locked in business models or barriers to entry are greater than the costs are what gets enacted. Any benefit to the public is frequently a side effect, and is very carefully tuned to optimize cost vs. market advantage for the regulated industry.