I have a BX 22 with 375 hours that suddenly shuts off. You can turn the key and it will start, run and throttle up as long as you hold the key clear to the right. Let go of the key or try to put it in gear or engage the PTO and it will quit. I have replaced the key switch and the safety cut-off switch and still won't run. The fuel filters have also been replaced.
Check the fuse to the fuel pump. The switch might bypass the fuse and if that is the case, then the pump will work while the key is in the start position, but die when it is released. If it starts in the start position, but won't run when the key is in the run position, then it has to be some thing that is energized in the start position, but is disconnected and gets power from some other terminal in the run position only. My only guess is that it is the fuel pump. The fuses are located under the radiator cover on the right hand side just below the key switch. There are only 2 safety switches on the BX22. The 3 point hitch and the transmission interlock. I believe that the engine stop is done by killing power to the fuel pump. A easy way to test this theory is to run a jumper wire from the positive terminal of the battery to the fuel pump. The fuel pump is located on the right hand side underneath the tractor. Remove MMM deck to access it. It is small and silver colored with a wire terminal running to it.