I mean yes, but also then the investment gets a lot bigger too.
In my country (Estonia), if we did solar + batteries only, the batteries would have to be large enough to withstand electricity consumption being smaller than production for the entire summer (which at its peak has 18 or 19 hours of sunlight per day and most people don't have AC so our summer electricity usage is smaller than winter).
And also from about october to march, there's almost no sunlight, and electricity consumption is through the roof because heat pumps have been pretty common in new builds and renovations for like 2 decades now, replacing mostly solid fuel furnaces rather than resistive electric heaters.
Which is not to say we should abandon solar, but it'd be incredibly cost-prohibitive to go renewables-only here. In the summer our electricity prices often go negative already (still zero + network fees for consumers, not really negative prices -.-), but in winter I've seen 5 euros per kilowatthour at peak times.
Now I googled the cost of a terawatt hour of battery capacity and Google's AI was happy to report to me that a terawatthour is a million kilowatt hours and thus at ~80€/kWh it would be 80 million euros. That's peanuts! Just 640 million would get us enough battery capacity to store a year's worth of energy, that should surely get through a winter!
Trouble is, I was taught slightly different values for the SI prefixes and back when I went to school, tera was a billion kilos. So if it still functions that way, we're talking hundreds of billions instead. Our national budget for the year is 20 billion. But if every person with a job paid just a million extra euros in tax, we could afford to do it!
So obviously, solar alone + batteries won't do it at such a high latitude. Wind power helps a ton, but that's still unpredictable. And after everyone on a flexible-price plan saw a 5x increase on their power bill for january (1000+ euros being pretty common), I don't think the people will settle for "works most of the time". We actually need a nuclear power plant and we need it to be built before December 2025.
Till then we'll continue burning dirty ass coal and (yay, even worse) shale. Which I fucking hate, but the economic reality of our country is that this is what we can afford right now, with a gradual buildout of solar + wind.
But funnily enough, if we got the hundreds of billions worth of batteries magically out of thin air, the cost of buying enough solar panels to produce the entire country's annual electricity consumption every year... Would be in the hundreds of millions range or a bit over a billion at most if this meme/infographic is to be believed, even if adjusting the capacity factor, which is more like 10-15% here due to our nasty winter. Chump change pretty much for a country like ours.