Found this out while playing, pretty repeatable.
Have a fleet with a capital ship in it sitting in a system with auto join on.
In the same system have a frigate yard, with a waypoint set.
Create 4 or 5 new frigates. The last one made will join the fleet then keep going back to the shipyards waypoint. Doesnt matter if you then move the whole fleet to another system that last ship will keep trying to go back to the shipyard waypoint. Only way Ive found to break it out of the loop is to remove it from the fleet.
D