Always be skeptical of what you learn in High School.
There is some daily difference in the height of the water on the Pacific and Atlantic sides of the Panama Canal, but it’s relatively small (10 feet or so), and is due to the tides and not to a difference in the average height of “sea level”.
As proof, look at the changes in elevation a ship goes through as it goes through the canal. Starting on the Pacific side, a ship starts at sea level and then is raised approximately 54 feet at the Miraflores locks (actually 2 raises of about 27 feet each). Then it proceeds through a man-made lake to the Pedro Miguel locks where it is raised another 31 feet or so. This puts it at about 85 feet above sea level. Going through some man-made cuts and channels, it comes to Gatun Lake, which is also about 85 feet sea level. After crossing the lake, it comes to the Gatun Locks, where it is lowered (in three steps) approximately 85 feet back down to sea level.
The locks exist because it was cheaper and easier (or at least the people building it thought it was, I’m certainly no expert) to boost the ships up and take advantage of the existing lake and some waterways (which were about 85 feet above sea level) instead of digging a simple canal all the way across.