A bag on the ground can be looted 'indefinitely' under certain circumstances (if it contains some stack of items?).
I'm not entirely sure about this but I think the issue can be consistently reproduced when the original bag contains countable stuff in a stack (like ammo) and specifically if I drag all that by mouse to the character's directory and confirm the transfer items dialog -> then the bag stays on the ground and new content is generated next time I open the inventory screen again (though probably only that countable part of the content is regenerated). It works like this both during and after combat.
When I loot the bag's content using 'take all' button or gradually by shift + click, the backpack once emptied normally disappears as I would expect to happen. If I drag by mouse countable item which is present in the amount of 1, I think it also doesn't happen. -> so perhaps the bug is related to the transfer items dialog mentioned above?