### Godot version

v4.1.rc2.official [46424488e]

### System information

Godot v4.1.rc2 - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.3623) - AMD Ryzen 7 5700G with Radeon Graphics (16 Threads)

### Issue description

When setting the AnimationTree to active, Godot crashes.

### Steps to reproduce

https://github.com/godotengine/godot/assets/46705245/dbe5eb81-1357-43e8-ac80-a4eb97eea9fc

### Minimal reproduction project

[Crash.zip](https://github.com/godotengine/godot/files/11945826/Crash.zip)

if (p_state_machine->get_state_machine_type() == AnimationNodeStateMachine::STATE_MACHINE_TYPE_GROUPED) {
		return; 
	}
	Vector<String> temp_path = p_path.split("/");
	if (temp_path.size() > 1) {
		for (int i = 1; i < temp_path.size(); i++) {
			String concatenated;
			for (int j = 0; j < i; j++) {
				concatenated += temp_path[j] + (j == i - 1 ? "" : "/");
			}
			Ref<AnimationNodeStateMachine> anodesm = p_state_machine->find_node_by_path(concatenated);
			if (anodesm.is_valid() && anodesm->get_state_machine_type() != AnimationNodeStateMachine::STATE_MACHINE_TYPE_GROUPED) {
				ERR_FAIL_MSG("Root/Nested AnimationNodeStateMachine can't have path from parent AnimationNodeStateMachine.");
			}
			Ref<AnimationNodeStateMachinePlayback> playback = p_tree->get(base_path + concatenated + "/playback");
			ERR_FAIL_COND(!playback.is_valid());
			playback->_set_base_path(base_path + concatenated + "/");
			if (p_test_only) {
				playback = playback->duplicate();
			}
			playback->_start_main(temp_path[i], i == temp_path.size() - 1 ? reset_request : false);
		}
		reset_request = false;
	}
}
bool AnimationNodeStateMachinePlayback::_travel_children(AnimationTree *p_tree, AnimationNodeStateMachine *p_state_machine, const String &p_path, bool p_is_allow_transition_to_self, bool p_is_parent_same_state, bool p_test_only) {