Hi, I had the same problem with my backhoe there can be three reasons for this problem.
1) The solenoid might be an issue as in JCB machines it is totally depended on electric systems so even a loose connection stops the machine
2)Change the discs and plates inside the gear shaft. As even if they are slightly damaged this can happen. (My Problem's solution )
3) The ultimate reason can also be torque convertor or oil pump. If these are faulty then this problem can also occur
Vaishakh Menon
October 2016