### Godot version

4.2-rc1

### System information

Windows 11, Vulkan

### Issue description

When using the NavigationAgent2D the "target reached" signal usually does not trigger if the target desired distance value is below the path desired distance.  If, however, the navigation agent target position is set while the agent is within the desired distance then it will reliably trigger.

This can be simulated by either issuing a nearby move command or by setting (and thus recalculating) the target position every frame.

### Steps to reproduce

1. Implement a basic CharacterBody2D
2. Add a NavigationAgent2D node and leave the default values
3. Set up the CharacterBody2D to move when its NavigationAgent2D has its movement position set (based on the Using NavigationAgents documentation)
4. Connect the on_target_reached and on_navigation_finished signals
5. Move the character around and observe that navigation is finished before the target is reached when the target position is set beyond the target desired distance
6. Move the character a small distance within the target desired distance; observe the target reached signal reliably triggers
7. Set the target desired distance higher than the path desired distance (or vice versa); observe that the target reached signal more reliably triggers.

### Minimal reproduction project

[target-reached-test.zip](https://github.com/godotengine/godot/files/13444552/target-reached-test.zip)

return avoidance_mask;
}
void NavigationAgent2D::set_avoidance_layer_value(int p_layer_number, bool p_value) {
	ERR_FAIL_COND_MSG(p_layer_number < 1, "Avoidance layer number must be between 1 and 32 inclusive.");
	ERR_FAIL_COND_MSG(p_layer_number > 32, "Avoidance layer number must be between 1 and 32 inclusive.");
	uint32_t avoidance_layers_new = get_avoidance_layers();
	if (p_value) {
		avoidance_layers_new |= 1 << (p_layer_number - 1);
	} else {
		avoidance_layers_new &= ~(1 << (p_layer_number - 1));
	}
	set_avoidance_layers(avoidance_layers_new);
}
bool NavigationAgent2D::get_avoidance_layer_value(int p_layer_number) const {
	ERR_FAIL_COND_V_MSG(p_layer_number < 1, false, "Avoidance layer number must be between 1 and 32 inclusive.");
	ERR_FAIL_COND_V_MSG(p_layer_number > 32, false, "Avoidance layer number must be between 1 and 32 inclusive.");
	return get_avoidance_layers() & (1 << (p_layer_number - 1));
}
void NavigationAgent2D::set_avoidance_mask_value(int p_mask_number, bool p_value) {
	ERR_FAIL_COND_MSG(p_mask_number < 1, "Avoidance mask number must be between 1 and 32 inclusive.");
	ERR_FAIL_COND_MSG(p_mask_number > 32, "Avoidance mask number must be between 1 and 32 inclusive.");
	uint32_t mask = get_avoidance_mask();
	if (p_value) {
		mask |= 1 << (p_mask_number - 1);
	} else {
		mask &= ~(1 << (p_mask_number - 1));
	}
	set_avoidance_mask(mask);
}
bool NavigationAgent2D::get_avoidance_mask_value(int p_mask_number) const {