Two decades ago, governments and utilities around the world began offering above-market rates and contracts to fuel the rise of clean energy, but now these pacts are under attack.