My very rough math seems to indicate you'd need like 50,000 GW of solar to replace everything.
If they last 25 years, that means you need ~2,000GW per year.
Solar panel wholesale prices are dirt cheap (like $0.20 per watt). So the cost to produce those is about $400b per year
Here is why Solar + Batteries + EVs replaces Fossil cars and generation:
Fossil era:
$2,500b in ICE Autos per year
~$1,000b in ICE auto parts per year
$1,300b in Oil production
~$500b in oil refining
~$500b in Natural Gas production
~$500b in coal production
=$6,300b total (about 9% of global GDP)
...can be replaced with:
Renewable era:
$2,500 in EV production
$250b in EV parts
$600b in stationary storage
$400b in solar panels
=$3,750b total... $2,550 in savings for the global population, not counting the horrible externalities of fossil fuels of course, or the hundreds of billions spent on war machines to keep the supply lines safe.