took the speed sensor out of my old 2005 axle with 31k miles on it and it works now
I don't think so. Your 2005 speedometer is driven by the PCM based on the pulse frequency from the OSS sensor in the transmission. It was the 98~00 Rangers that took the raw VSS signal from the rear axle ABS sensor.
FWIW, the speedometer in the electronic cluster in my Focus was working intermittently last winter. One drive it would work, the next it was on zero and vice versa. I ended up replacing the whole cluster with one from eBay.
That's weird cause it works fine now after switching the speed sensor
So if it turn out to stop working again I need to buy a whole cluster?
Not necessarly. My point is that the cluster may intermittently work and not work and give the impression that the problem has been solved when it has not. Your problem could be the OSS, the cluster or something in the wiring.