### 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 (path.size()) {
			path.remove_at(0);
		}
		
		_set_current(p_state_machine, next.node);
		current_curve = next.curve;
		_reset_request_for_fading_from = reset_request; 
		reset_request = next.is_reset;
		pos_fade_from = pos_current;
		len_fade_from = len_current;
		if (next.switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_SYNC) {
			p_state_machine->blend_node(current, p_state_machine->states[current].node, MIN(pos_current, len_current), true, false, 0, AnimationNode::FILTER_IGNORE, true);
		}
		
		double rem = 0.0;
		if (next.is_reset) {
			len_current = p_state_machine->blend_node(current, p_state_machine->states[current].node, 0, true, false, 0, AnimationNode::FILTER_IGNORE, true, true); 
			rem = len_current;
		} else {
			rem = p_state_machine->blend_node(current, p_state_machine->states[current].node, 0, false, false, 0, AnimationNode::FILTER_IGNORE, true, true); 
		}
		
		if (rem > len_current) { 
			len_current = rem;
		}
		pos_current = len_current - rem;
		
		if (fading_time) {
			break;