There was a proposed project to build a massive solar wind and battery installation in Morocco, and link it to the UK via undersea cable. I believe it collapsed due to the lack of companies able to supply that much cable and the current government also didn’t support it. Also geopolitics still matters, any government is going to be very wary about getting a significant portion of electricity from a region that might become hostile in the future. Your comment ignores that.
https://en.wikipedia.org/wiki/Xlinks_Morocco%E2%80%93UK_Powe...