The answer is to think up new widgets to be made so that the excess production capacity can stay busy.
The problem with your solution is that making widgets takes energy. And there’s few ways of producing energy that don’t produce CO2. Starting a widget factory with the new CO2 regulations that are in the regulatory pipeline would likely be unprofitable.