### Godot version

4.0.rc1

### System information

Windows 10

### Issue description

I'm not 100% sure what's causing it, but something in the blend tree of the animation tree doesn't play the correct animations when running. 

The problem happens when you jump for a 2nd time. It plays the fall animation for 1 loop before switching to the jump animation. It should only play the jump animation when moving upwards. Same effect happens rarely with the idle playing while jumping. 

![BlendTreeBug](https://user-images.githubusercontent.com/48493009/217973489-f5e84658-7fdc-4ba8-8a59-d23ab2611236.gif)



I think it has something to do with the transition nodes and some kind of blend between the 2 animations. Even though the xfade time is set to 0 on all transition nodes. Here's an image of the whole animation tree/ blend tree.

![AnimationTree](https://user-images.githubusercontent.com/48493009/217973509-c1c61888-a7a5-4d59-b2db-8f55d47f6679.PNG)



I have a simple script, mostly made of integrated/default code + a small amount I added for adjusting what animation to play in the blend tree. 3 animations. Idle, jump, and fall, shown below.

![bugProjectCode](https://user-images.githubusercontent.com/48493009/217973524-1931d8da-b0f7-46d3-9236-888c45712557.PNG)



### Steps to reproduce

open included project, start game, press jump button (space) twice. (it works like it should the first time. But only the first time)

### Minimal reproduction project

[BlendTreeBug.zip](https://github.com/godotengine/godot/files/10702792/BlendTreeBug.zip)

ERR_FAIL_COND(!nodes.has(p_node));
	nodes[p_node].connections.resize(nodes[p_node].node->get_input_count());
	emit_signal(SNAME("node_changed"), p_node);
}
void AnimationNodeBlendTree::_bind_methods() {
	ClassDB::bind_method(D_METHOD("add_node", "name", "node", "position"), &AnimationNodeBlendTree::add_node, DEFVAL(Vector2()));
	ClassDB::bind_method(D_METHOD("get_node", "name"), &AnimationNodeBlendTree::get_node);
	ClassDB::bind_method(D_METHOD("remove_node", "name"), &AnimationNodeBlendTree::remove_node);
	ClassDB::bind_method(D_METHOD("rename_node", "name", "new_name"), &AnimationNodeBlendTree::rename_node);
	ClassDB::bind_method(D_METHOD("has_node", "name"), &AnimationNodeBlendTree::has_node);
	ClassDB::bind_method(D_METHOD("connect_node", "input_node", "input_index", "output_node"), &AnimationNodeBlendTree::connect_node);
	ClassDB::bind_method(D_METHOD("disconnect_node", "input_node", "input_index"), &AnimationNodeBlendTree::disconnect_node);
	ClassDB::bind_method(D_METHOD("set_node_position", "name", "position"), &AnimationNodeBlendTree::set_node_position);
	ClassDB::bind_method(D_METHOD("get_node_position", "name"), &AnimationNodeBlendTree::get_node_position);
	ClassDB::bind_method(D_METHOD("set_graph_offset", "offset"), &AnimationNodeBlendTree::set_graph_offset);
	ClassDB::bind_method(D_METHOD("get_graph_offset"), &AnimationNodeBlendTree::get_graph_offset);
	ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "graph_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR), "set_graph_offset", "get_graph_offset");
	BIND_CONSTANT(CONNECTION_OK);
	BIND_CONSTANT(CONNECTION_ERROR_NO_INPUT);
	BIND_CONSTANT(CONNECTION_ERROR_NO_INPUT_INDEX);
	BIND_CONSTANT(CONNECTION_ERROR_NO_OUTPUT);
	BIND_CONSTANT(CONNECTION_ERROR_SAME_NODE);
	BIND_CONSTANT(CONNECTION_ERROR_CONNECTION_EXISTS);
	ADD_SIGNAL(MethodInfo("node_changed", PropertyInfo(Variant::STRING_NAME, "node_name")));
}
void AnimationNodeBlendTree::_initialize_node_tree() {