I notice that it's always worth opening chests at least twice in the game. It's quite common for a chest to be full of loads of stuff, and then when you empty it, close it and open it again you find there's a suit of platemail or something you missed down the cracks in the sade of the chest!I think it generates a list of items to go in the chest, and then tries to place them randomly in the chest. If it can't find a place for a given item in the chest, it's still in there, but you can't see it until you've removed enough stuff to make space for it, and then close/reopened the chest.
Some chests I have to open 3 times to get all the stuff.
So always open chests a couple of times so you don't miss things!
--Chandor