Your enemy doesn’t need to bomb the solar panels from a solar plant, they can just target the grid connection instead.
Unless you make rooftop solar + batteries with variable rate accessible for everyone (like Australia is said to have done), then yeah there will be no easy target.
But even then, your enemy could still target your grid stabilization infrastructure/peaker plants and make those who were not able to afford batteries lose power.
I wish grid operators could have some sort of remote control/feedback of “smart residential inverters” to be able to stabilize the last mile of the grid independently, maybe through a lora mesh or whatever their meters use.
The grid tends to be somewhat grid-shaped, and even industrial-scale solar doesn't usually have a large centralized grid hookup.
It's like trying to starve a country by bombing its supermarkets: you could try, but in reality you're mostly wasting bombs.