The likeliest reasons are that it was undercooked or unmolded too soon. The flan will be quite fragile when taken out of the oven. Let it cool down at room temperature then chill it before trying to invert it onto a plate.