### Godot version

v4.2.dev.custom_build [0ca854232]

### System information

Pop Os 22.04 lts 12th Gen Intel® Core™ i7-12700H × 20 NVIDIA RTX A2000 8GB 32.0GB  ram

### Issue description

A node that has a script attached to it and it has a couple of child nodes (type of a child node doesn't matter). In the script you have an export variable of type Node. You save the scene into a file and you add it in level scene. When you start to duplicate that scene in the level and you'll hover over exported variable to show a node path, it will show an incorrect path. 


https://github.com/godotengine/godot/assets/33091666/75088d1b-c014-41e0-bae3-46610eccbad1



### Steps to reproduce

1. create a scene with a node and a child node.
2. attach a script to the parent node and create an export variable of type Node
3. assign child node to that exported variable through the editor
4. save the scene and create a level scene where you are going to add just saved scene.
5. _Possibly requires a reboot of the engine before seeing the bug_
6. start duplicating nodes in the level scene

### Minimal reproduction project

[NodeTest.zip](https://github.com/godotengine/godot/files/12781547/NodeTest.zip)

copytarget = p_copy->get_node(ptarget);
				}
				if (copy && copytarget && E.callable.get_method() != StringName()) {
					Callable copy_callable = Callable(copytarget, E.callable.get_method());
					if (!copy->is_connected(E.signal.get_name(), copy_callable)) {
						int arg_count = E.callable.get_bound_arguments_count();
						if (arg_count > 0) {
							copy_callable = copy_callable.bindv(E.callable.get_bound_arguments());
						} else if (arg_count < 0) {
							copy_callable = copy_callable.unbind(-arg_count);
						}
						copy->connect(E.signal.get_name(), copy_callable, E.flags);
					}
				}
			}
		}
		for (int i = 0; i < n->get_child_count(); i++) {
			process_list.push_back(n->get_child(i));
		}
	}
}
static void find_owned_by(Node *p_by, Node *p_node, List<Node *> *p_owned) {
	if (p_node->get_owner() == p_by) {
		p_owned->push_back(p_node);
	}
	for (int i = 0; i < p_node->get_child_count(); i++) {
		find_owned_by(p_by, p_node->get_child(i), p_owned);
	}
}
void Node::replace_by(Node *p_node, bool p_keep_groups) {