There may be a momentary cut-out switch that is bad or going bad. The switch should break & make the ignition circuit when you shift into gear to take the load off the shift gears. Had that problem on a `86 Mercruiser 140hp IO. Every time I tried to shift into forward or reverse it died. Thank God it was at the dock and not out on the lake :shock: .
Something to check out.