Originally Posted by
Kdixer
Next time it happens, check to see if your key switch has completely returned to the "On" position.
My 2019 Mercury Pro XS 115 was doing this exact thing. I was able to finally simulate it and resolve the issue. You can hold the key slightly past the on position with the engine running in neutral. If you shift into gear while holding the key in this position it will kill the engine due to the neutral safety circuit. It will automatically restart when returning to neutral due to the key position.
In my case, my key switch had been installed upside down meaning the drain hole was at the top. I believe this is what caused the switch to begin sticking. It was as if the o-rings or seals had dried out creating too much friction for it to spring return to the "on" indent. It had me stumped because it was intermittent. It seemed to only happen on short runs or after being on the water in the sun for a bit. I guess the longer runs were enough to "bounce" the key back to the on position.