proverb

Accidents will happen, in the best regulated families.

misfortune

states that

No matter how carefull we are, things will go sometimes wrong, by accident or mistake.

It is used

To console someone who has done a mistake.