Had this problem with my FED Science officer, frustrating as hell. Did the loop 5 times and still the problem persisted. Finally, instead of leaving the system as per instructions, I contacted Starfleet and handed in my mission on the spot. Once you leave the system, you're screwed.