Whenever you are stuck in a place that you cannot stand such as underneath a slab and close a Trapdoor or Fence Gate on yourself where there isn't enough space to start swimming, a client-side bug happens where you can walk at normal speed and render as standing normally in 3rd person perspective while you are registered as sneaking on the server. You can still sneak normally without falling off, but your sneaking speed will be as if you were walking normally. Other players on the server render you as sneaking while your client will render you as standing. I've attached a video that shows this bug being in more detail.
Thank you for your report!
However, this issue is a Duplicate of MC-195736.
It has been linked to this report. If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki