Rather, the government should invest in research so solar + storage (let's call it green energy) becomes cheap enough that people want to use it.
This is not because its better that people want to do it, or because capitalism is glorious.
This is because you want the incentives in the right place. If green power were cheap enough, that would mean you solve the latency problem, the efficiency problem, the distribution problem and the waste problem.
Simply mandating rooftop solar might make some of these problems worse.