Before hanging on any parts, I suggest you check the integrity of all related wiring and connectors. Next you could check the resistance of the downstream O2 heated circuit. If that's in spec, you might remove, check, clean, and reinstall the sensor. If none of that fixes the issue, then replace the sensor.

AFA the P0502, that's a correlation code, and doesn't (by itself) positively ID the speed sensor as the culprit. One of the possibilities is some issue related to the wheels. Have the wheels been replaced by a non-standard size, or have the wheels or axles possibly been damaged recently?