Invisible bags tooltip claim that items will not move when you use compact but having one piece of bloodstone dust in your inventory will cause it to move the the stacks from your invisible bag into the rest of the loot. (only happens if you have the same item in your normal bag as you do in the invisible one)
Glitch is most likely a sub-class of the sorting not picking up on the restriction.