### 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
if (!grid_enable[a]) {
			continue; /
		}
		int b = (a + 1) % 3;
		int c = (a + 2) % 3;
		Vector3 normal;
		normal[c] = 1.0;
		real_t camera_distance = Math::abs(camera_position[c]);
		if (orthogonal) {
			camera_distance = camera->get_size() / 2.0;
			Vector3 camera_direction = -camera->get_global_transform().get_basis().get_column(2);
			Plane grid_plane = Plane(normal);
			Vector3 intersection;
			if (grid_plane.intersects_ray(camera_position, camera_direction, &intersection)) {
				camera_position = intersection;
			}
		}
		real_t division_level = Math::log(Math::abs(camera_distance)) / Math::log((double)primary_grid_steps) + division_level_bias;
		real_t clamped_division_level = CLAMP(division_level, division_level_min, division_level_max);
		real_t division_level_floored = Math::floor(clamped_division_level);
		real_t division_level_decimals = clamped_division_level - division_level_floored;
		real_t small_step_size = Math::pow(primary_grid_steps, division_level_floored);
		real_t large_step_size = small_step_size * primary_grid_steps;
		real_t center_a = large_step_size * (int)(camera_position[a] / large_step_size);
		real_t center_b = large_step_size * (int)(camera_position[b] / large_step_size);
		real_t bgn_a = center_a - grid_size * small_step_size;
		real_t end_a = center_a + grid_size * small_step_size;
		real_t bgn_b = center_b - grid_size * small_step_size;
		real_t end_b = center_b + grid_size * small_step_size;
		real_t fade_size = Math::pow(primary_grid_steps, division_level - 1.0);