You need to take the cover off the pressure switch and do that test again. If at 40 PSI the points in the switch do not make, or touch together, then the nipple to the pressure switch is probably clogged. If the switch points make at 40 PSI, but the pump doesn't start for some time after that, then the overload in your motor is tripping. Not doing it everytime makes me think it is the overload in your motor tripping. Which means you have already cycled your pump to death, and it is just waiting for the most inoppurtune time to completely quit.