Occasionally when I left or right click a gump or an item inside a pack, the game ignores the bag/gump and instead will focus on an item behind the bag (example shown in pic below, leather was on the ground behind the bag). Sometimes when I right click to close a bag, my character will instead take a step and the bag remains open.
Interesting, not sure I have ever seen this before. It could be related to UO being slightly confused about the position of your active UO window. Is it in the upper left corner? Client 5.0.8.3?
I find that the crafting gumps especially and that of BoD books, has an 'overhang' of unseen window where I can click/drag it without actually having my cursor on it. Perhaps the 'shown' gump and what the client thinks is there are two different dimensions.
I have this problem as well. When right clicking to close a gump outside of my active game window my character will sometimes walk a step in that direction (my window is in the upper left corner.) There are certainly other effects but I thought this particular phenomena might help solve the problem as it suggests that the game isn't mistaking where the gump is but where the cursor is or, as Chris said, where the entire window is.