It does have to be grid competitive, and it isn't. Many regions had or have ridiculous subsidies that are paying outrageous rates to the owner of solar panels for their generation (for example, in Ontario, where I live, initial deals of this sort had the power company paying $0.85 or so per kWh. The going rate for them to sell power is around $0.18/kWh at on-peak rates. Over the last several years, they've stepped it down and down and the current rate is still around $0.28/generated kWh)
This generated a lot of small companies offering to install panels on your house for free, in exchange for giving you the $0.18/kWh your electricity would have normally cost you, and taking the excess of the oversized subsidies - netting them profit over the 20 year deal, and giving the homeowner functionally free electricity. It was a completely bonkers deal in the early days - it makes no sense whatsoever for the grid to purchase power for 85c/kWh and sell it for 18c/kWh - not only that, the rate was locked in for 20 YEARS! It was an even better deal for the homeowner who had their own capital to tie up in the solar panels for 20 years - the ROIC was huge.