This generally isn't how markets or economics works. If power generation isn't profitable, many companies will just stop doing it. Prices will rise, making it attractive to more companies to do it.
Power generation will still be profitable in my imagined scenario, just not from selling the raw electricity as a product.
Luckily there are several industries that make more money the cheaper electricity is, so there is some market pull in that direction already. Data centers tend to cluster around places with cheap power and/or cold climates, for example.
Consider roads. Having free access to road networks generates enormous value for society, much more than if we had tried to extract tolls on every road.
I think the same should apply for electricity. Free or nearly free access to electricity is likely to create value that far outweighs the value generated by selling electricity.
The existing power-selling industry will of course fight this every chance they get.