The Factorio spider navigation is slightly complicated for large spiders. If they are too fast, they will overshoot the target location and start rotating in one spot unable to reach the point they wanted to go to. I have tried to solve this by lowering speed and implementing despawn mechanics - if player is far away from the spider for 5 minutes it will despawn, so they would not stay stuck forever.
If you see them just standing frozen, it is likely that they are guarding base or giving up and trying to heal where old base was.
I figure giving a new order to go to a random place, when spider has not reached a target point for 10 seconds might be a solution.
I am not sure if it is caused by rampant or not. The spiders do depend on unit groups when attacking with other enemies, but since spidertrons are technically vehicles, not units, they cannot respond to unit commands. This might cause unexpected behavior.