### Godot version

v4.1.beta.custom_build [522a2ea3f]

### System information

Windows 10, Vulkan, GTX 960 536.23

### Issue description

When the grid is disabled in a scene and subsequently closed, it will not be displayed again and will remain invisible unless you refresh it from the 'view' option. This doesn't happen with the origin, but sometimes its colors may appear faded if you try to activate the grid again.

### Steps to reproduce


https://github.com/godotengine/godot/assets/48926464/c31770de-55c3-403a-8d91-07fc1184cae1

Note: It is not necessary to open or create a scene, just follow the steps shown in the video.

### Minimal reproduction project

N/A
viewport->set_use_debanding(use_debanding);
	const bool use_occlusion_culling = GLOBAL_GET("rendering/occlusion_culling/use_occlusion_culling");
	viewport->set_use_occlusion_culling(use_occlusion_culling);
	const float mesh_lod_threshold = GLOBAL_GET("rendering/mesh_lod/lod_change/threshold_pixels");
	viewport->set_mesh_lod_threshold(mesh_lod_threshold);
	const Viewport::Scaling3DMode scaling_3d_mode = Viewport::Scaling3DMode(int(GLOBAL_GET("rendering/scaling_3d/mode")));
	viewport->set_scaling_3d_mode(scaling_3d_mode);
	const float scaling_3d_scale = GLOBAL_GET("rendering/scaling_3d/scale");
	viewport->set_scaling_3d_scale(scaling_3d_scale);
	const float fsr_sharpness = GLOBAL_GET("rendering/scaling_3d/fsr_sharpness");
	viewport->set_fsr_sharpness(fsr_sharpness);
	const float texture_mipmap_bias = GLOBAL_GET("rendering/textures/default_filters/texture_mipmap_bias");
	viewport->set_texture_mipmap_bias(texture_mipmap_bias);
}
void Node3DEditorViewport::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_READY: {
			EditorNode::get_singleton()->connect("project_settings_changed", callable_mp(this, &Node3DEditorViewport::_project_settings_changed));
		} break;
		case NOTIFICATION_VISIBILITY_CHANGED: {
			bool vp_visible = is_visible_in_tree();
			set_process(vp_visible);
			set_physics_process(vp_visible);
			if (vp_visible) {
				orthogonal = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_ORTHOGONAL));
				_update_name();
				_update_camera(0);
			} else {
				set_freelook_active(false);
			}