On the Nintendo Switch version of the game this issue can be temporarily solved by toggling on and off the Touchscreen Mode. I attached the video
[media]to demonstrate that. However it reappears after You open any other inventory
I also not sure how it works, but there was another issue MCPE-137009 which reported the same issue, however it was closed for lack of information
I found the exact steps to recreate the issue. At first it looked random. Sometimes the cursor jumps, sometimes it does not. However there is a logic, not randomness. Cursor will jump to a different place only if it lands in between inventory cells. It will work as expected if You stop it directly inside any inventory cell
Also I want to remind that on Nintendo Switch version the issue can be temporarily solved via toggling on and off the Touchscreen Mode by simply touching the screen and moving Left Stick afterwards. However it returns immediately after You open the Inventory again
Hope it helps, since this issue is really annoying