So whenever you are standing at the block of an open trap door if you close the trapdoor it makes you do the swimming effect.
This only applies when the trapdoor is one block directly above another solid block
Linked issues
Attachments
Comments

Thank you for your report!
We're tracking this issue as MC-147612, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automagically! Please report any issues in Discord or Reddit
This is a feature called crawling, been in the game for a while now