### 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)

} else {
		group_end_transition = Ref<AnimationNodeStateMachineTransition>();
	}
	
	if (anodesm->get_state_machine_type() == AnimationNodeStateMachine::STATE_MACHINE_TYPE_GROUPED) {
		indices = anodesm->find_transition_from(anodesm->start_node);
		int anodesm_start_size = indices.size();
		indices = anodesm->find_transition_to(anodesm->end_node);
		int anodesm_end_size = indices.size();
		if (group_start_size > 1) {
			WARN_PRINT_ED("There are two or more transitions to the Grouped AnimationNodeStateMachine in AnimationNodeStateMachine: " + base_path + ", which may result in unintended transitions.");
		}
		if (group_end_size > 1) {
			WARN_PRINT_ED("There are two or more transitions from the Grouped AnimationNodeStateMachine in AnimationNodeStateMachine: " + base_path + ", which may result in unintended transitions.");
		}
		if (anodesm_start_size > 1) {
			WARN_PRINT_ED("There are two or more transitions from the Start of Grouped AnimationNodeStateMachine in AnimationNodeStateMachine: " + base_path + current + ", which may result in unintended transitions.");
		}
		if (anodesm_end_size > 1) {
			WARN_PRINT_ED("There are two or more transitions to the End of Grouped AnimationNodeStateMachine in AnimationNodeStateMachine: " + base_path + current + ", which may result in unintended transitions.");
		}
		if (anodesm_start_size != group_start_size) {
			ERR_PRINT_ED("There is a mismatch in the number of start transitions in and out of the Grouped AnimationNodeStateMachine on AnimationNodeStateMachine: " + base_path + current + ".");
		}
		if (anodesm_end_size != group_end_size) {
			ERR_PRINT_ED("There is a mismatch in the number of end transitions in and out of the Grouped AnimationNodeStateMachine on AnimationNodeStateMachine: " + base_path + current + ".");
		}
	}
}
void AnimationNodeStateMachinePlayback::_set_grouped(bool p_is_grouped) {