When someone makes a mistake (not regarding a mitzvah or a sin), and suppose it leads to tremendous suffering and regret; they can’t believe how they could do something so “foolish.” Is it to be assumed that Hashem decreed such suffering on that person, or is it strictly that person’s free will to have made such a mistake?
It is hard to make a rule out of this either way. We do see that there is an idea that there are times when a person will make a “mistake”, but this mistake is really part of H-shem’s plan for something big to take place afterwards. See Matnas Chaim (Shabbos pg. 32) that R’ Mattisyahu Solomon shlit”a speaks about this idea. On the other hand, we have to be careful not to make mistakes, and we have to know that we have to be careful how we lead our life, and to know that if we act foolishly it might cause us unnecessary suffering and pain. It really depends on the individual circumstance. If you would like to discuss it in more detail, in a private way. Let me know.