Go thru all earth connections and make sure their all nice and clean, could and emphasise, could be the starter on the way out but not likely as I’ve not heard of them failing, starter moters can do things like that when the insulation starts to break down on the armiture, have you checked the voltage of the battery when hot? Just thinking.