I just posted this in answer to another question, but it applies here too. Consider a low voltage relay kit. When you turn the key electrical current flows from your ignition switch through your PTO neutral, clutch safety, and all the other safety switches, to the starter solenoid. When all the switches, cables and battery, etc. are new there is very little resistance.

With time and age, resistance builds up and eventually will cause a voltage drop at the starter solenoid. This voltage drop will vary according to temperature, humidity and other factors. That’s why some times it'll work fine and other times it won’t. The starter solenoid needs approx. 9 volts to fully engage, anything less and it won’t fully make contact to send current to run the starter motor. Yes it will click, but it needs just a little more power to fully seat on the contacts and allow the starter motor to run. Instead of replacing all the components in the system to reduce the voltage drop, try a low voltage starter relay. Several companies have come up with a pre-wired relay kit with instructions, John deere, Scag, and others, have them available. The low voltage relay kit will work with as low as 4 volts.

Stop by your local John Deere dealer and get JD kit part #AM107421, it’s easy to install, It's pre-wired, comes with instructions. Mount the relay and change a few wires... The instructions that come with the kit and are easy to follow – a 15 minute job. The Parts man at a JD dealership told me about these kits years ago when I thought I needed a solenoid, he said it’s a common problem, and saved me a bunch of money. I have solved the “sometimes it just clicks” problem several times on different brands of machines with this kit.