This will involve a mix of wind, solar, hydro, geothermal and nuclear on grids that span continents with massive battery stores to balance supply with demand. Between climate change and petroleum-fuelled kleptocrats, ditching fossil fuels is a necessity, not a choice. And the long term here is on the order of decades, not centuries, so within most of our our lifetimes.
I guess humanity is still not ready for such projects of enormous cooperation between countries, or, that there are too many things in the way, like said temperature rise at day and fall at night, the vast distance the energy would need to be transported (is that a problem?) and maintenance work somewhere in the desert. One can still hope, that some day we will be able to think globally and solve problems that way.
I sometimes hear that too. The YouTube channel "Real Engineering" did a video about the idea: [1] The TLDR is: the Sahara definitely gets enough sun, but transmitting the power into Europe would be hard.
Applying alternative energy sources where it doesn't make sense to do so ends up throwing billions of dollars on having solar panels where they can never generate the energy they theoretically could (Germany, I'm looking at you)