### Godot version

v4.2.dev (221884e6b)

### System information

Godot v4.2.dev (221884e6b) - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Ti Laptop GPU (NVIDIA; 31.0.15.3699) - 12th Gen Intel(R) Core(TM) i7-12700H (20 Threads)

### Issue description

When you are switching between open scenes the animation toolbar above the viewport can appear out of context. One example is having an animation player in a 3D scene (there is no animation toolbar in the 3D viewport), then switching to a 2D scene. The toolbar would be visible and the bottom panel would be expanded, despite no animation player or active animation being present in the second scene. Toggling the bottom panel fixes the state.

### Steps to reproduce


https://github.com/godotengine/godot/assets/11782833/f60cef64-1abc-4908-91ef-a8d12204383c



### Minimal reproduction project

N/a
Point2 corner = Point2(begin.x, end.y);
		Vector2 length_vector = (begin - end).abs() / zoom;
		const real_t horizontal_angle_rad = length_vector.angle();
		const real_t vertical_angle_rad = Math_PI / 2.0 - horizontal_angle_rad;
		Ref<Font> font = get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
		int font_size = 1.3 * get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));
		Color font_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
		Color font_secondary_color = font_color;
		font_secondary_color.set_v(font_secondary_color.get_v() > 0.5 ? 0.7 : 0.3);
		Color outline_color = font_color.inverted();
		float text_height = font->get_height(font_size);
		const float outline_size = 4;
		const float text_width = 76;
		const float angle_text_width = 54;
		Point2 text_pos = (begin + end) / 2 - Vector2(text_width / 2, text_height / 2);
		text_pos.x = CLAMP(text_pos.x, text_width / 2, viewport->get_rect().size.x - text_width * 1.5);
		text_pos.y = CLAMP(text_pos.y, text_height * 1.5, viewport->get_rect().size.y - text_height * 1.5);
		
		viewport->draw_line(begin, end, ruler_primary_color, Math::round(EDSCALE * 3));
		bool draw_secondary_lines = !(Math::is_equal_approx(begin.y, corner.y) || Math::is_equal_approx(end.x, corner.x));
		if (draw_secondary_lines) {
			viewport->draw_line(begin, corner, ruler_secondary_color, Math::round(EDSCALE));
			viewport->draw_line(corner, end, ruler_secondary_color, Math::round(EDSCALE));
			
			int arc_point_count = 8;
			real_t arc_radius_max_length_percent = 0.1;
			real_t ruler_length = length_vector.length() * zoom;
			real_t arc_max_radius = 50.0;
			real_t arc_line_width = 2.0;
			const Vector2 end_to_begin = (end - begin);