Here's the fun thing: if humanity were one united species instead of a bunch of tribes willing to fuck each other up every few decades, we might just go and grow crops where they grow the best, maybe with a bit of redundancy to guard against natural disasters and whatnot.
But unfortunately we are not, and so we have massive overproduction going on, which in turn means without insane amounts of subsidies (25% of the EU budget goes to farm subsidies!) farms could not survive.
If the subsidies were killed, even shit solar panels would yield more money than a lot of land could yield with growing crops.
For few years, then every solar farm would go bankrupt all while food supplies gone.
TBF New Zealand is one of the few countries that removes subsidies from farmers - it was terrible for few decades, but eventually turned out to be great.
If there is one thing effectively infinite, it is humanity's demand for energy, particularly with the growing demand from switching transportation and heating over to electricity.
And food supply wouldn't be gone, it would just migrate e.g. to Ukraine.