felix culpa

noun: An error or disaster that has fortunate consequences.