I think it might actually have to do with the order of the items in the given bag- and if it changes due to sorting or whatnot, it may pick the wrong item.

But I"m just hypothesizing so don't take anything I say too seriously.