The world is, and I know this might be a shocker, round.
Railguns when tested have an odd issue in that they shoot things real fast, and therefor a much flatter ballistic trajectory. Now this is good! if the curve of the earth did not put a fuck load of water between the railgun and the target. In fact due to physics (you know that thing that we are both clearly experts in) you end up with a big old dead spot in your range tables (more so with high sea states) where the railgun's dart will hit the waves on route to the target and although moving wicked fast the uncaring ocean will still stop or really change the darts course. This changes when you range out far enough that the ballistic trajectory curves enough but at those ranges accurate guidance is another issue (this was found out in 2019).
So yeah according to physics shooting a thing at over 8000 km/h out of a tube means a flatter then needed trajectory for mid range (in ship to ship context) and when you get out to the full range you are talking 180 km or so, and at that point even the super fast darts are avoidable/hard to get on target.