As I recall orbital habitats, asteroid miners, terraformers, fuel harvesters, and possibly maintenance modules sometimes bug when you send them to join a pre-existing task group stationed at a planet, I think the solution is to send them to the planet first then join the old task group. Another workaround which I know works is to tell the whole group to move away then back again.