You are being overly critical of yourself for something we all encounter. Give yourself some room to make mistakes, and always remember when you make a mistake it does not mean you are a mistake.
If your memory
fails you consistently consult your doctor to rule out any medical issues and if cleared you could seek advice from a psychologist. Best wishes.