### Godot version

v4.0.beta16.official.518b9e580

### System information

Vulkan API 1.2.231 - Apple M1 Max

### Issue description

AnimatedSprite2D `play` seems to not work anymore. Maybe it is related to https://github.com/godotengine/godot/pull/71907
I have two animations: `default` and `hurt`.
<img width="865" alt="Screen Shot 2023-01-28 at 11 06 13" src="https://user-images.githubusercontent.com/3025661/215270842-998dc3e5-7695-4099-a9b3-8b52ef66d768.png">
<img width="865" alt="Screen Shot 2023-01-28 at 11 06 19" src="https://user-images.githubusercontent.com/3025661/215270891-c4df02e2-444c-4477-b273-bb13d909ea84.png">


---

When I call `play("hurt")` nothing happens.
<img width="506" alt="Screen Shot 2023-01-28 at 11 07 41" src="https://user-images.githubusercontent.com/3025661/215270901-119c0801-d6cb-432b-b320-f7e2822a6511.png">


https://user-images.githubusercontent.com/3025661/215270941-d56753fb-8653-40e6-8094-98537fb88187.mov



### Steps to reproduce

Download the project, run the project and press space bar. The expected behavior is switch the green checkmark for a red X.

### Minimal reproduction project

[animated_sprite_2d.zip](https://github.com/godotengine/godot/files/10527438/animated_sprite_2d.zip)

StringName name = p_name;
	if (name == StringName()) {
		name = animation;
	}
	ERR_FAIL_COND_MSG(frames == nullptr, vformat("There is no animation with name '%s'.", name));
	ERR_FAIL_COND_MSG(!frames->get_animation_names().has(name), vformat("There is no animation with name '%s'.", name));
	if (frames->get_frame_count(name) == 0) {
		return;
	}
	playing = true;
	custom_speed_scale = p_custom_scale;
	int end_frame = MAX(0, frames->get_frame_count(animation) - 1);
	if (name != animation) {
		animation = name;
		if (p_from_end) {
			set_frame_and_progress(end_frame, 1.0);
		} else {
			set_frame_and_progress(0, 0.0);
		}
		emit_signal("animation_changed");
	} else {
		bool is_backward = signbit(speed_scale * custom_speed_scale);
		if (p_from_end && is_backward && frame == 0 && frame_progress <= 0.0) {
			set_frame_and_progress(end_frame, 1.0);
		} else if (!p_from_end && !is_backward && frame == end_frame && frame_progress >= 1.0) {
			set_frame_and_progress(0, 0.0);
		}
	}
	notify_property_list_changed();