### 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)

#ifndef CANVAS_MODULATE_H
#define CANVAS_MODULATE_H
#include "scene/2d/node_2d.h"
class CanvasModulate : public Node2D {
	GDCLASS(CanvasModulate, Node2D);
	Color color = Color(1, 1, 1, 1);
protected:
	void _notification(int p_what);
	static void _bind_methods();
public:
	void set_color(const Color &p_color);
	Color get_color() const;
	PackedStringArray get_configuration_warnings() const override;
	CanvasModulate();
	~CanvasModulate();
};
#endif