Had the same thing happen, it turned out to be the bendix. On the bench it seemed okey but it couldn't handle the load of turning an engine, sometimes
I was able to buy just the bendix from a auto electric shop. I needed help, there's a special clip that held it on. I just brought the pieces in and they just took the clip off for free, I could get it on by myself.