If a player happens to be within the collision/bounding box of a solid block (regardless of being a fully block or a partial block), the player gets into swimming/gliding mode.
This can be recreated by teleporting into a such blocks at player's leg, /setblock-ing at player's leg into such blocks, using pistons to put such blocks into place, and also closing/opening trapdoors/doors/fencegates while player's would be in such blocks' bounding box at their other states.
Related issues
duplicates
Attachments
Comments

[media]