If you have a central power nuclear/gas/coal station and a bomb hits it, nobody has power.
if that happens it can be repaired more economically and faster – as has been repeatedly shown in Ukraine.
Chances are my roof won't be gone though.
If a central power plant is destroyed, 0% of the neighbourhood will have power, but 100% will have roofs.
Which is better in your opinion?
Solar panels are easy to spot from a drone, and fragile, so it's easy to damage them.
My friends in Ukraine charge their ecoflows with a generator, because if you put a solar panel outside your drone team bunker, you invite incoming artillery.
And how do you plan to get the fossil fuels for these generators? Gas stations and oil pipelines are even easier and more centralised targets than solar panels.
I think you're thinking of massive gigantic centralised solar power plants, what if every single house has enough solar for the basic necessities, would Putin just carpet bomb every neighbourhood to rubble just to destroy the cheap Chinese solar panels?
Heat vastly increases solar generation and battery demand.
If your goal is to stay on grid the payoff on solar isn't really realized for 10+ years, when not only are the panels paid off but the accumulation factor of a country full of people with solar panels reduces the grid strain on the conventional sources you list. Adding them for war-time reasons is overall a net negative vs just buying diesel heaters, distributing solar for actual off-grid purposes so people have communications, etc. It is not going to meaningfully reduce dependency on those sources during the period of the war -- that's why I assumed it had to be for off-grid alternative because in that case it would achieve that goal.
Of course it is better than nothing, assuming they did not waste too many domestic resources doing this Greenpeace stunt. But this on-grid solar component is not a serious proposition for wartime demand, and you would be WAY better off donating to maintaining/defending the existing hydro/nuclear/coal generation than trying to deploy enough solar to move the needle for solar grid resiliency within the timespan of the war. I guess I just assumed they were acting rationally and that is why I thought it might be used in off-grid scenarios, but you've disillusioned me of that.