If a ship is just flying from A to B and it's not harvesting or trading, it cannot be stopped. Only ships that are harvesting or trading can have their AI cancelled.
Is there a chance for future improvement to stop any ship?
I watched in pain my colony ship approaching black hole sector and could not stop it.