I ran into that problem once, too... for projectiles flying above water (with modified pathing types, well at least it was the same problem)
And I could not find a solution back then, I doubt there is one.
The difference in height is very small, so I think its best to just ignore this difference...
Otherwise, if its possible in your map (probably not), use custom water -> a little model instead of the actual wc3 water... but that isnt a very nice solution.
Another idea: Ive not tried it yet, and it should be laggy, but it could work... You could create terrain deformations not affecting water, increase the terrain height a lot, use GetLocationZ() then, and restore the old terrain height... laggy and annoying...
If its important, and needs to be fast, you could do all this on map start and save the values in a giant bunch of arrays... not recommended, but its the fastest option ingame probably... requires long loading time though
however, as i already said, my recommendation is to just forget about this little difference, or make shallow water even more shallow... OR you make the cliffs steeper, and shallow water on the same height everywhere, then you can always subtract a constant value from GetLocationZ()...
still best: forget about it