this is from experience from a LS430
if you pull the speed sensor, you need to clean it up and place it back very carefully to align it back to aim at the spokes on the shaft.
if it has a protective metal cover, you must ensure this is aligned and squashed back properly.
aiming it is very awkward and i don't know how to replicate how i successfully did it. it required some stiff plastic tubing, lots of pictures from a camera and carefully tightening it afterwards.
if you are off by even a slight degree and it isn't aimed properly, you may have to start all over again.
this is time consuming if you don't get it right because you need to jack up the car, remove the wheel, mess with it, put the wheel back on, remove the jack, clear the code, try again.
you'll need to get some wire, preferably from a paperclip into the OBD2 ports.
this should trigger a diagnostic and reset. hopefully it clears. give it a drive and pray you aligned it properly.