Let's say that AI is a massive massive success and increases energy demand and ends up consuming 10% of electricity. I don't know if that's realistic, it's probable high, but let's assume it's correct within 10x.
Then, if that ramps up energy demand a lot, what happens? We deploy far more energy generation. Is that a problem? No, actually that will accelerate our energy transition to zero carbon. Already, nearly all of the new energy added in 2024 will be solar, batteries, and wind, because that's what's cheapest. Solar and battery will be 81% of the power capacity added (comparing different techs by power instead of energy has limitations, but assume a 20% capacity factor for solar to get to energy, 50% for gas, and 90% for nuclear):
https://www.eia.gov/todayinenergy/detail.php?id=61424
Further, since solar, batteries, and wind are all on technology learning curves, the more we build of them, the cheaper they become. So if we accelerate building and deployment, the faster they get cheaper.
That means, the faster we build more renewable tech, the quicker it gets to replacing carbon-based energy, on the merits of cost. Some natural gas plants, right now, cost more in fuel to run than it would cost to build a solar farm next to them, and use the solar when the sun is shining, and gas at night. The cheaper it gets, the sooner solar can economically replace more and more existing natural gas generation sites
Similarly for storage, right now it's an extra $90/MWh or so to store a MWh, and the sooner that drops in price, the more existing carbon sources can be replaced. Data centers that need their own backup power, and run on a combo of solar plus batteries, are a perfect application for this tech.
Meanwhile, existing energy infrastructure is loooong lived. Unlike computer tech, which depreciates quickly, you will have generations equipment in place for decades. So that means that the replacement rate for electricity generation is low, unless there is a big increase in demand.
Fortunately electrification of many industries is increasing electricity demand, and accelerating solar/battery/wind deployment and tech curves, but accelerating this with even more demand from AI would likely have positive effects rather than negative effects.