So basically when you swim (sprint-swim) you get "stuck" when you attempt to swim under a ceiling. Basically you are "lagging" on the same spot and cannot move until you change position. Really makes taking out ocean monument 10x harder cause you cannot swim around and get stuck.
Would MC-233582 happen to describe your issue? If not, please provide some screenshots or videos of this issue occurring whilst the F3 debug screen is enabled.