### Godot version

v4.0.rc4.official [e0de3573f]

### System information

macOS 13.2.1, 2.3 GHz Quad-Core Intel Core i7, Vulkan API 1.2.231 - Forward+ - Using Vulkan Device #0: Intel - Intel(R) Iris(TM) Plus Graphics

### Issue description

Hiding a `CanvasModulate` node yield errors in the console.

<img width="590" alt="image" src="https://user-images.githubusercontent.com/2452791/221310681-0648e8e4-6afb-4492-9a93-e1dfe5c15ff2.png">

```
E 0:00:00:0988   get_canvas: Condition "!is_inside_tree()" is true. Returning: RID()
  <C++ Source>   scene/main/canvas_item.cpp:814 @ get_canvas()
E 0:00:00:0988   canvas_set_modulate: Condition "!canvas" is true.
  <C++ Source>   servers/rendering/renderer_canvas_cull.cpp:430 @ canvas_set_modulate()
E 0:00:00:0988   get_canvas: Condition "!is_inside_tree()" is true. Returning: RID()
  <C++ Source>   scene/main/canvas_item.cpp:814 @ get_canvas()
```
- https://github.com/godotengine/godot/blob/e0de3573f3fc86062763152f5a1ac62f5a986da3/scene/main/canvas_item.cpp#L814
- https://github.com/godotengine/godot/blob/e0de3573f3fc86062763152f5a1ac62f5a986da3/servers/rendering/renderer_canvas_cull.cpp#L430

I use a `CanvasModulate` node to add some ambient color to my scene and I usually toggle it on/off to have a better view of the scene, having it throw errors is a bit distracting.

### Steps to reproduce

- Create a `Node2D` scene

- Add a `CanvasModulate` child

- Run the Scene 
  - No error:
  <img width="1018" alt="image" src="https://user-images.githubusercontent.com/2452791/221312208-af897bb1-db0c-4a0e-b340-096a0e63c6fa.png">


- Hide the `CanvasModulate` by clicking the eye icon
- Run the Scene 
  - Errors:
  <img width="1027" alt="image" src="https://user-images.githubusercontent.com/2452791/221312325-0cafd9c6-18d3-4d4c-a6d2-ea4cf2c7e083.png">


### Minimal reproduction project

[test.zip](https://github.com/godotengine/godot/files/10829307/test.zip)

#include "canvas_modulate.h"
void CanvasModulate::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_ENTER_CANVAS: {
			if (is_visible_in_tree()) {
				RS::get_singleton()->canvas_set_modulate(get_canvas(), color);
				add_to_group("_canvas_modulate_" + itos(get_canvas().get_id()));
			}
		} break;
		case NOTIFICATION_EXIT_CANVAS: {
			if (is_visible_in_tree()) {
				RS::get_singleton()->canvas_set_modulate(get_canvas(), Color(1, 1, 1, 1));
				remove_from_group("_canvas_modulate_" + itos(get_canvas().get_id()));
			}
		} break;
		case NOTIFICATION_VISIBILITY_CHANGED: {
			if (is_visible_in_tree()) {
				RS::get_singleton()->canvas_set_modulate(get_canvas(), color);
				add_to_group("_canvas_modulate_" + itos(get_canvas().get_id()));
			} else {
				RS::get_singleton()->canvas_set_modulate(get_canvas(), Color(1, 1, 1, 1));
				remove_from_group("_canvas_modulate_" + itos(get_canvas().get_id()));
			}
			update_configuration_warnings();
		} break;
	}
}
void CanvasModulate::_bind_methods() {