If the AR1420 driver lets the telescope go to its mechanical end-stop in any direction, it gets confused, because it loses track of where it is.
Add software limits, so that the telescope will drive close to, but not up to, these end-stops. Options:
Perhaps advise the caller that the commanded slew would go beyond possible travel, and refuse to do anything
Head off in the right direction, but stop short.
Once the driver is able to handle slews into the Forbidden Sector (oooh, scary), it might be able to avoid this problem entirely.
A tracking activity should stop before it hits the end-stop.