### Godot version

4.0.rc

### System information

Any

### Issue description

If the RESET animation is generated at the same time as the Bezier track is generated, the bezier edit button will not be active.

![image](https://user-images.githubusercontent.com/61938263/218256176-88b1b196-7b6b-4404-84ad-e8694f23bb1b.png)

Also, if you delete a track in the Bezier Editor, or in undo redo, it will not update correctly.

### Steps to reproduce

![image](https://user-images.githubusercontent.com/61938263/218256230-4b0219d5-87e4-453a-8294-59f8feb0cfd5.png)


### Minimal reproduction project

N/A
}
		for (int j = 0; j < p_animation->track_get_key_count(i); j++) {
			Variant v = p_animation->track_get_key_value(i, j);
			if (!Variant::can_convert(v.get_type(), valid_type)) {
				p_animation->track_remove_key(i, j);
				j--;
			}
		}
		if (p_animation->track_get_key_count(i) == 0 && cleanup_tracks->is_pressed()) {
			p_animation->remove_track(i);
			i--;
		}
	}
	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
	undo_redo->clear_history(true, undo_redo->get_history_id_for_object(animation.ptr()));
	undo_redo->clear_history(true, undo_redo->get_history_id_for_object(this));
	_update_tracks();
}
void AnimationTrackEditor::_view_group_toggle() {
	_update_tracks();
	view_group->set_icon(get_theme_icon(view_group->is_pressed() ? SNAME("AnimationTrackList") : SNAME("AnimationTrackGroup"), SNAME("EditorIcons")));
	bezier_edit->set_filtered(selected_filter->is_pressed());
}
bool AnimationTrackEditor::is_grouping_tracks() {
	if (!view_group) {
		return false;
	}
	return !view_group->is_pressed();
}
void AnimationTrackEditor::_selection_changed() {