it shouldn't sort unless you select one of the sort options, I tend to use the sort a lot, so not sure if it triggers periodically and thats what is messing you up. I do know that I can have gaps in my inventory after selling or moving items around (I tend to force a sort at that point to clean it up)