Historically electric grids were mostly formed by spinning generators. Using their electromagnetic components they produce nice sinewaves of voltage and current, synchronous to the spinning of the generator.
Nowadays however, more and more solar, wind and battery sources are added to the grid. Especially solar and battery sources produce direct current. They need to be fitted with an inverter to be able to feed power into the grid.
I imagine a pure sine wave inverter is more complex and therefore more expensive to produce than an inverter that simply chops of the flow and creates rectangular waves.
I would like to understand the following:
On a grid level, why is it bad to have rectangular waves compared to sine waves?