Under UNCLOS, SOLAS and the SAR Convention, masters of vessels (including Royal Navy ships) must assist persons in distress at sea regardless of nationality or status. This duty applies in French waters, and ships may enter them for genuine rescue. Overloaded or unseaworthy migrant boats are often treated as being in distress.
Rescue is completed by delivering the persons to a “place of safety”, a location where their lives are no longer threatened, basic needs can be met, and onward transport can be arranged. The state responsible for the search-and-rescue region where the recovery occurs has primary responsibility for coordinating that delivery. There is no automatic rule that this must be the geographically nearest port.
France is a safe country and could serve as a place of safety, but a UK vessel cannot unilaterally enter a French port or unload people there without French consent. Doing so would violate French sovereignty and the rules on innocent passage under UNCLOS, because unloading persons contrary to the coastal state’s immigration laws is not innocent passage. France is entitled to refuse disembarkation. Any such return requires prior agreement and coordination; none currently exists for unilateral action of this kind.
The Royal Navy is therefore neither obliged nor automatically entitled to take the boat to a French port, and France is not acting illegally by preventing it.