Welcome to Cartaholics.
9 out of 10 times intermittent problems like that are a bad cable or connection at the batteries or the forward and reverse switch. Other things you can check would be the key switch, solenoid, micro switches, contacts in the forward and reverse switch.