Hi,
Here is an unlisted YouTube clip of me playing the game where I start to move around without pressing any buttons.
It looks like it can occur when hitting uneven ground (holding nothing) or getting close to an object (crate or barrel) when holding something.
You can still teleport. That is how I managed to get back down to the last room when I previously played it after floating up from the second room.