### Godot version

f73cb4c13d1bc19b044fbef735522e3b0249e8ab

### System information

Windows 10, Vulkan

### Issue description

A CSGPolygon3D node with 'use_collision' on, in Path mode, with a path node assigned, throws the error "Node3D::get_global_transform: Condition "!is_inside_tree()" is true. Returning: Transform3D()" when running (and in some cases when switching scenes).

![image](https://user-images.githubusercontent.com/115422160/211907313-20742234-4a1f-4d94-b573-544b8e1d07ca.png)

~~In this same MRP you can also see a different error, when switching between scenes in the editor, that I've mentioned in https://github.com/godotengine/godot/issues/58869, I can open a separate issue if needed:~~
I've opened a separate issue for this in https://github.com/godotengine/godot/issues/71750.
![image](https://user-images.githubusercontent.com/115422160/211907528-1df7230e-6270-4669-bf44-2ef449eebf1d.png)



### Steps to reproduce

Run the MRP. It's a simple Node3D scene with a CSGPolygon3D and Path3D as children.

### Minimal reproduction project

[transform bug.zip](https://github.com/godotengine/godot/files/10395682/transform.bug.zip)

const double longitude_step = Math_TAU / radial_segments;
		int face = 0;
		for (int i = 0; i < rings; i++) {
			double latitude0 = latitude_step * i + Math_TAU / 4;
			double cos0 = Math::cos(latitude0);
			double sin0 = Math::sin(latitude0);
			double v0 = double(i) / rings;
			double latitude1 = latitude_step * (i + 1) + Math_TAU / 4;
			double cos1 = Math::cos(latitude1);
			double sin1 = Math::sin(latitude1);
			double v1 = double(i + 1) / rings;
			for (int j = 0; j < radial_segments; j++) {
				double longitude0 = longitude_step * j;
				
				
				double x0 = Math::sin(longitude0);
				double z0 = Math::cos(longitude0);
				double u0 = double(j) / radial_segments;
				double longitude1 = longitude_step * (j + 1);
				if (j == radial_segments - 1) {
					longitude1 = 0;
				}
				double x1 = Math::sin(longitude1);
				double z1 = Math::cos(longitude1);
				double u1 = double(j + 1) / radial_segments;
				Vector3 v[4] = {
					Vector3(x0 * cos0, sin0, z0 * cos0) * radius,
					Vector3(x1 * cos0, sin0, z1 * cos0) * radius,
					Vector3(x1 * cos1, sin1, z1 * cos1) * radius,
					Vector3(x0 * cos1, sin1, z0 * cos1) * radius,