I had such bug couple of times - autopiloted ship for no reason changes the direction and goes to completely different direction as ordered.
There have been issues with ships losing their autopilot destination and merely sitting in one location. This issue has existed to a greater or lessor degree in a number of different revisions of the game. Not sure the state of this under v1.5 or DA.
But it sounds like what you're talking about is something that's not really a bug. I'm just guessing, but what can happen is that when you click on a autopilot destination it may turn out that the "real" destination is set to some other ship/fleet. When that ship/fleet moves then ships that may have that ship/fleet as a destination will follow the original ship/fleet.
This most often happens when you set a ships autopilot destination to a rally point and there are ships and/or fleets already at that rally point. Clicking on the rally point sometimes sets the autoplilot destination to be the rally point but just as likely will make a ship/fleet that's sitting at the rally point the destination. If that ship/fleet moves the first ship follows. You can tell by looking at the details of an errant ship. If it says the destination is fleet 1234 instead of rally point 1234 or xy location (123,456) then that's what's going on.
I've also done what Gre_Magus describes. When you select a ship it takes a moment before the screen centers on that ship. If you're trying to click on a destination while the screen is moving, the autopilot destination is set god knows where the the ship takes off in the wrong direction, but it doesn't sound like this is what you're talking about.
