sometimes they are intent on leaving, It is a good idea to put a queen includer in the box (an excluder between the hive body itsself and the entrance, to seal the queen in for the night.
A frame of open brood helps them stay as well. They don't like to abandon brood.
But it may just be they felt they were to close to the parent colony. I've heard it helps to move them a few miles away for a week or so before moving them back, but I've never tried it.