Leonardo was wrong about this. It is not due to sea level dropping (except in very isolated cases), it's due to the land rising. Sedimentary rocks that form in sea beds are often uplifted by tectonic processes to form mountains and plateaus. See e.g. https://en.wikipedia.org/wiki/Sedimentary_rock
Note that this answer was given when this question was on biology.stackexchange.com. @jamesqf has IMO a better, more informed, more helpful answer below. I don't pretend to know much of anything about geology!
I'd say that Geology is the better venue, but nonetheless here is an answer.
Note that there are lots of reasons why elevation ...
Another way to look at this is to consider that everything that was dug out was then filled by sea water. Based on this (non realistic, see below) hypothesis, we need the amount of excavated rocks as a proxy for water volume. The Panama Canal Museum "interesting facts" webpage has:
Excavation by French useful to present Canal (cubic yards) 29,908,...
It's important to note that major man-made navigational canals often are often routed so that only a smaller bit of new waterways is dug; they are typically made by connecting existing waterways with smaller cut\cuts across higher mountainous areas, plus shortcuts in any place where straightening the route saves significantly.
It seems hard to find detailed ...