https://en.wikipedia.org/wiki/Panama_Canal
Construction began: 1 January 1881
Date completed: 15 August 1914
> The energy released when lowering can be stored either in gravitational energy of a mass, or be used to power a second parallel lock operated in counter phase (so while one lock is lowering ships say eastwards, the energy is used to raise ships traveling westwards, and afterwards their roles reverse). To speed up a second gravitational potential energy store (and optional flywheel) can be used to accelerate and decelerate the pumping.
if the canal didn't exist, and we were designing it as a greenfield project in 2026, that would definitely be a design worth considering.
could it be retrofitted onto the existing canal? sure, in theory.
in practice, they currently handle 36 ships per day, and lowering that limit by just 2-4 per day is significant enough that it makes international news [0]
so whatever retrofitting you have in mind, the construction would need to be done completely non-invasively, without disrupting the daily operation of the locks. it's nowhere near as simple as you're making it out to be.
0: https://www.lemonde.fr/en/economy/article/2026/08/21/panama-...