Whenever the bees are trapped inside a box, it’s been my experience they always want to pile out whenever the entrance is opened again. After they're satisfied their home/exit is safe again, they go back inside (unless it really is too hot). I suspect they are more concerned about being trapped than overheating, but I don’t know for sure.