When you (or the AI, I assume) give the fleet an order, every ship in the fleet is given that order. As written, a fleeted ship will move to leader if it has no order.
If I tell the fleet to move A, and then tell a fleet member to refuel, the refueler will complete his mission and then follow the fleet leader. If I give the fleet another order, the refueler will lose his refuel order and take on the fleet order. So "special" missions are only fulfilled if the fleet is "idle". A way to work around this is to move the fleet leader, which mean the rest will follow and the "special order ones" carry on with their missions.
This mean that if you are in the nasty situation with a ship on low fuel, and you need the fleet to attack, you either need to drop the refueler from the fleet, or make sure to always order the fleet around by selecting all ships present and ordering them to attack, etc.
Ships (and fleets) will take on refuel order if they judge themselves to be critically low on fuel. The way around this is to never be particularly low on fuel.
I am quite happy there are no messages on fleets being idle, as that is my default stance for them. My fleets are parked in spots where they are ready to act on a nearby emergency. Or they are actively used in war, in which case I pay attention to them. If I want an idle fleet to do some mission (but a pirate mine or whatever), I typically queue up "return to base", "refuel", "move to X" or similar to not have to pay attention to them completing their kill.
If a "proper" fleet is close to the mine bust, though, I will just order a few of fleet members to kill the mine, and they will move back to leader afterwards. Just make sure the fleet leader is not among them and drags the whole fleet along to be parked at the position of the destroyed mine.