In the end I see it as having multiple independent energy-generating clusters (each building, or each city, or each country) and sharing excess energy outside the cluster only when needed.
They can’t, though. Apartment buildings are too efficient at packing people together to have enough per capita roof square metrage for panels. Practical wind turbines are huge. A typical wind turbine blade is longer than the height of a 10 story building. Geothermal is also rather impractical as a source of energy, due to low thermal conductivity of the rock.
> In the end I see it as having multiple independent energy-generating clusters (each building, or each city, or each country) and sharing excess energy outside the cluster only when needed.
You are describing here exactly the current status quo. That how energy works right now.