OK
As you can see, everyone chimes in with their pet fault without reading the entire thread or working in a methodical way.
So now we have ruled out a mechanical problem on the deck.
This means that your problem has to be in the wiring itself.
By now hopefully you have your wiring diagram in hand
From it you will see that a lot of things are connected to the B & W wire that goes to the magneto.
If any one of them closes and connects the black ( ground ) wire to he B & W the engine stops .
Usually if the seat switch is bad, the engine stops when you let off the parking brake .
If this was your problem then you would not be able to drive the mower anywhere.
Although I have seen some where a bad connection on the seat switch has caused your problem but allowed the mower to move.
So pull the set switch apart then reconnect it hard .
Have you located the Reverse switch yet ?
Starting to look like the culprit