Not sure about your tractor, but my
L4400 has a latching type fuel solenoid... meaning you hear an audible click when you turn the key on, (that is the solenoid being energized...) that moment, the solenoid is being latched in the run position mechanically.
Once it latches, power is removed and the mechanical latch holds it in the run position.
When you get ready to shut the unit off, power is once agian applied and the latch is tripped, moving it to the fuel off position.
Does the tractor shut off like you turned the key off, or is it stumbling/fuel knocking and trying to run but just dies? If its doing any of the latter, I would do as others suggested, look at the fuel supply system.
If its dying like you turned the key off, look into the electrical system.