I had similar problem with Massey Ferguson 165. Solenoid would click but not engage the starter. You may have to try numerous times before it would engage the starter to turn the engine. The problem is that there is not enough power going through the solenoid to engage starter. The solution is to wire a relay into the starter circuit. It’s not that difficult. It’s an known design problem which appears on older tractors/diesel engines. Here’s a link to it on another forum reply #18.
I bought a generic relay and wired it myself. see link for part on amazon.
Red to power line into starter(30), Black to earth (85), white (86) to ignition switch and blue(87) to original cable on ignition switch to solenoid.
I had spare spade on the power line from the starter on the ignition switch so I wired power from there. The white and blue cables go between ignition switch and existing solenoid cable.
Starter engages first time now without any issues