Random starter trouble
Try to test "in place" without disturbing anything. You might have a simple bad connection someplace---even inside a cable you can't see, and moving it when you disconnect.
When it quits, take a screwdriver, and jam down between the terminals right on the starter
You should be able to tell by sound and "spark" what the trouble is
Weak spark and "buzzy click" means weak battery or bad cables
Good spark but one click means trouble right in the starter itself. Bad solenoid or internal starter trouble.