Intermittent start up, electric system checks out

Three times this winter my car failed to start on cold mornings after sitting in the garage all night. When I return later, it starts perfectly. I have all the interior light turned off. Even though my battery and alternator checked out OK, I went ahead and replaced the battery. The connectors were cleaned and scuffed up for better connection. I had my brake pads replaced last week and once again they said the electrical system and battery were good. This is such a mystery as it only fails to start 1 out of 100 times. Any ideas. I don’t want to drop a ton of money and still have the problem.

The next time the engine won’t start, and with the ignition switch on step on the brake pedal and shift the transmission into neutral and then try starting engine. If the engine starts there’s a problem with the park/neutral safety switch.

Tester