Here's the thing: it all comes from your mind.
The deepest reason for making mistakes in the pedal line is your focus. Our thoughts wander all over the place during the practice and performance. This state of mind often causes you do depress the notes with your feet without being 100 % sure. If you aren't absolutely sure you will play the correct notes, you will probable make mistakes.
The secret is to be laser-focused on the spot you are playing right now.