When you left-click, the client generates a list of directions to move your character to that tile, sends that list to the server, and then the server will attempt to walk that list:
otland/forgottenserver (https://github.com/otland/forgottenserver/blob/a880956e6e7d0cebd6eba996e4cda10fe2fc554f/src/protocolgame.cpp#L738-L768)
When you right-click, the client should only give you context menu; as far as I know, you can't right-click to walk unless you select the "Use" option from the context menu that is shown. If the item is usable, and you're too far away, it will then attempt to walk to that item:
otland/forgottenserver (https://github.com/otland/forgottenserver/blob/a880956e6e7d0cebd6eba996e4cda10fe2fc554f/src/game.cpp#L2111-L2136)
I do see the "You cannot use this object." message in your video, so it shouldn't be getting past that if-statement.
Hopefully that's enough information to get you started.