### 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
Node *dup = get_child(i)->_duplicate(p_flags, r_duplimap);
		if (!dup) {
			memdelete(node);
			return nullptr;
		}
		node->add_child(dup);
		if (i < node->get_child_count() - 1) {
			node->move_child(dup, i);
		}
	}
	for (const Node *&E : hidden_roots) {
		Node *parent = node->get_node(get_path_to(E->data.parent));
		if (!parent) {
			memdelete(node);
			return nullptr;
		}
		Node *dup = E->_duplicate(p_flags, r_duplimap);
		if (!dup) {
			memdelete(node);
			return nullptr;
		}
		parent->add_child(dup);
		int pos = E->get_index();
		if (pos < parent->get_child_count() - 1) {
			parent->move_child(dup, pos);
		}
	}
	return node;
}
Node *Node::duplicate(int p_flags) const {