I’m not sure the exact cause, it’s either after finding several successive underwater ruins or perhaps it’s to do with how close you approach by starship (as I tend to fly to and from each ruin, being rare and far apart) but eventually all underwater ruins you come across will be floating a mile high out of reach.
The fix is actually quite simple, soon as you hit your first floating ruin;land, save, quit, reload. That simple, your ruin will now be back underwater
(I literally passed dozens of ruins glitched like this before experimenting with them and discovering this )