### Godot version

4.1 dev

### System information

Win 10

### Issue description

Have a node and bunch of child nodes.
Some get _ready called, and some do not.

### Steps to reproduce

create a scene and bunch of child nodes with different sripts.

### Minimal reproduction project

n/a
if (this == p_node) {
		return const_cast<Node *>(p_node);
	}
	HashSet<const Node *> visited;
	const Node *n = this;
	while (n) {
		visited.insert(n);
		n = n->data.parent;
	}
	const Node *common_parent = p_node;
	while (common_parent) {
		if (visited.has(common_parent)) {
			break;
		}
		common_parent = common_parent->data.parent;
	}
	if (!common_parent) {
		return nullptr;
	}
	return const_cast<Node *>(common_parent);
}
NodePath Node::get_path_to(const Node *p_node, bool p_use_unique_path) const {