I get what you are saying but bad and good are too open ended in their definition.
I have a saying I use that is kinda similar and may define your point a bit better;
“Regret can turn into wisdom over time”
It’s not an always thing, but if you can reflect on your regrets you can gain wisdom from your mistakes to better yourself going forward.