Likely caused by the new crouching features, I.E. being forced into crouch when a trap door is closed above you or if a piston pushes a slab on your head, when swimming in the swimming animation against a ceiling, the game forces you to crouch, kicking you out of the swimming animation. Noticed this when I was ocean-ifying my underground base. Going to the ceiling consistently kicked me out of the swimming animation, causing movement to be incredibly difficult.
Reproduced by swimming into a ceiling underwater.
MC-148627 Swimming up to a ceiling makes the player crouch