Public energy transition policies often use forward-looking scenarios of energy demand, production and cost to determine the cost of the future electricity mix. These projections can determine the direction of policy support for certain types of energy but often represent a central planner operating in a deterministic environment. This assumption is very strong for long-term (decades) investments and neglects uncertainty and the role of risk aversion. However, recent years have taught us the strength that unexpected extreme events (COVID-19 crisis, war in Ukraine) can have on electricity demand and fuel prices. Moreover, it is difficult to establish precisely in advance the productivity of renewable energies, especially in the presence of more frequent extreme weather events with climate change. We evaluate the deviations of a deterministic optimal renewable energy investment path in the presence of uncertainty on key factors (load, capacity factor and gas price) from an anticipated stochastic trajectory using dynamic programming. We perform a simulation exercise calibrated on the German energy transition as an illustration.