It could be because the caramel was whisked during the cooking process or left at room temperature for too long before being transferred to the fridge for storage.