It's the whole centralized vs. decentralized conundrum. Each have their plusses and minuses.
And while it's indeed become possible to generate one's own electricity for a not "absurd" investment, it's still expensive (to get anything remotely reliable and generating a decent amount of power), intermittent (as solar/wind are pretty much the only realistic options you have). With the grid, you can reliably power millions of homes each consistently getting up to several kW reliably, at any hour. It's (almost) impossible to get that same result with any kind of reasonable investment, even these days, with an independent system.
As to being restricted, yes, in some countries there are restrictions of various kinds, but these days (due to the advent of renewable energy), it's usually possible without too many problems, at least if you're completely independent from the grid. If you're still connected to it, there are usually many rules and some restrictions.
The only thing you may have to do is have your installation checked by a professional (if you did it yourself). And, of course, make sure your installation is not causing issues to your neighbors if you have any. May seem obvious, but if you suddenly install several windmills on your property, your neighbors may not like the view or the noise. Let alone if you install generators that burn stuff.