Clean all connections with DeOxit contact cleaner. Check all edge connector pins for distortion. Use DeOxit cleaner on all connections. A very small amt. of corrosion will cause intermintent problems that can drive you crazy.
The manual has a list of things to check before any troubleshooting, IMHO, it is usually over looked when reading the manual, because it is before the actual troubleshooting procedures.
Make sure the truck has a static strap that touches the floor, If a wood floor, make sure there are grounded patches to run over somewhere in the operation for the static strap to touch and discharge. Make sure the battery is in good condition and does not drop more than 10% of it's "at rest" voltage when in hydraulic stall at the top of it's lift ability (do not stall more than 4 seconds). With the battery disconnected, make sure there is at least 100K ohm resistance between ANY of the power cables and the frame of the truck.
Clean all corrosion from under the battery and the battery itself, and replace any cables that show signs of the insulation being damaged or swelling or soaked (covered) in corrosion. (dispose of all corrosion and materials in an environmentally safe manner)
I would also add that checking the mast and carriage rollers/bearings for play/wear is a must when checking an intermittent mast switch problem.