If there is too much moisture in the bread after baking, or the bread is underbaked in the centre, it may collapse as it cools. Bake for longer, lowering the temperature of the oven if the crust browns before the middle is cooked through.