Weird speedometer problem

I'm thinking it's not your cable.
Never seems to be the problem.
See how the clearance between the little ears on the back of your speedo spinning thing and round thing they surround is tight.
It's a magnetic coupling.
That space gets either dirt in the space or less likely it worn and letting the ears grab the round thing every once in a while.
Clean it and lube the shaft with LPS 1. (greaseless lube.)
then take a short piece of speedo cable scrap and run the thing in an electric drill to functional test it before putting it back in the car.
I've done lots of them like that.

I'm talking about the later square speedos.
If yours is an earlier one, they may be made different and you can't see the back of them.
I don't know.