Let's try a little divide and conquer approach here.
Have you tried removing the deck drive belt from the PTO to make sure isn't a deck problem? If still doing it then we're looking at safety switch problem or massive electrical draw from the electric PTO coil.
To check if it is a safety that causing the problem simply unplug the PTO clutch electrical connector and test. If it still shuts down then it is a safety switch or wiring problem.
PTO coil with massive amount of current draw would cause the overall available voltage to drop so low that the after fire fuel solenoid on the carburetor would drop out and cause the engine shut down due the lack of fuel. I have seen these electric PTO draw over 15 amps and still work but would drain the electrical system to where the engine shutdown. Normally these pulls 3-7 amps depending on the voltage. Their coil resistance should not be below 1.6 ohms.