The shift interrupter switch momentarily shorts the ignition when shifting OUT OF GEAR, either forward or reverse.
When the short shift cable, The one that goes from the shift bracket to the transom, gets old, has been exposed to overheating or a few other issues it will cause the interrupter switch to be made when shifting in to gear, typically reverse but sometimes forward also.
If no one has messed with the cable adjustments and it has shifted fine in the past then it is most likely the short shift cable.
If someone has messed with the cable adjustments or replaced a shift cable either the control or short one then they need to be adjusted properly.
If the cable is tested to be good then the issue may be in the linkage in the gimbal housing.............