You may not be able to control what happens to you, but you can control how you react to it, i.e. perspective.
Usually, such things happen because of a mistake. The nature of the mistake is not always obvious and you may never figure out what it was.
If you do, you can make sure that you don’t make the same mistake twice.
As you said, dwelling on it too long is a worse mistake.
Something happened on my first job that I did not figure out until 30 years later. The event didn’t hurt anything, but I was happy to figure out what my managers had to be discussing (about me) for an hour.