I've had this experience several times:
I made a stupid, low-level mistake, felt terrible, and kept blaming myself—and that self-blame was incredibly frustrating.
N years later (N > 10), I suddenly realized that it was precisely because of that stupid mistake and the constant self-blame that I recently and perfectly avoided a similar, much bigger, disastrous mistake. What a close call! What luck!