My 2013 Kubota l5030 started shutting off intermittently with a clicking noise that sounded kind of like an electrical short. Long story short it ended up being the OPC controller behind the control panel by the steering wheel was shorting out and turning the fuel solenoid on and off. You can bypass the OPC by connecting the three wires that have a colored stripe using pigtails and leave the solid black wire which is the ground open. Hopefully this helps someone avoid the hassle I had to go through diagnosing this.
And welcome to our forum.