There's a fine line between a sin and a mistake. Unfortunately, many take mistakes as a sin and vice versa but actually, they are different and a person has to be rational enough to see the fine line in between.
It is a sin when a person knows that it's wrong, UNHOLY, and obviously bad but still continues to do so just to please oneself. THAT IS THE SIN.
On the other hand, mistake is an act done without the person knowing the consequences of his actions. Mistakes are NOT DONE INTENTIONALLY. They just happen without the person knowing that his decisions or his actions are actually wrong. They happen but see, you get to learn from these mistakes. You just have to look at the bright side.
WHY DO MISTAKES OFTEN MISTOOK AS A SIN?
This is because most people are blinded by what their physical eyes see. They don't dive and see beneath the surface. They easily judge. They often speak with regards to the negative side and don't let themselves enlightened by the bright side of mistakes. I am not saying that mistakes are good but obviously, they are not that bad. It's just how a person sees it.