### 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
void Node::_update_children_cache_impl() const {
	
	data.children_cache.resize(data.children.size());
	int idx = 0;
	for (const KeyValue<StringName, Node *> &K : data.children) {
		data.children_cache[idx] = K.value;
		idx++;
	}
	
	data.children_cache.sort_custom<ComparatorByIndex>();
	
	data.external_children_count_cache = 0;
	data.internal_children_back_count_cache = 0;
	data.internal_children_front_count_cache = 0;
	for (uint32_t i = 0; i < data.children_cache.size(); i++) {
		switch (data.children_cache[i]->data.internal_mode) {
			case INTERNAL_MODE_DISABLED: {
				data.children_cache[i]->data.index = data.external_children_count_cache++;
			} break;
			case INTERNAL_MODE_FRONT: {
				data.children_cache[i]->data.index = data.internal_children_front_count_cache++;
			} break;
			case INTERNAL_MODE_BACK: {
				data.children_cache[i]->data.index = data.internal_children_back_count_cache++;
			} break;
		}
	}
	data.children_cache_dirty = false;
}
int Node::get_child_count(bool p_include_internal) const {