I think i have finaly find source of this bug!!!
It happens when you are selling by double clicking, AND you move your mouse, even fragment of milimeter seems to be enough.

In such case game dont seem to understand what did you try to do ... since you sell your item, and moved it at once ... therefore it resolves is as that you sold it > and you moved it to your inventory ... as if you stole it.

Its not easy to replicate, but happened to me like 5times when i was sheaking my mouse so i dare to say im quite sure this is the cause!

Hope this helps in finding solution.