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

mode = p_mode;
	_make_dirty();
	update_gizmos();
	notify_property_list_changed();
}
CSGPolygon3D::Mode CSGPolygon3D::get_mode() const {
	return mode;
}
void CSGPolygon3D::set_depth(const float p_depth) {
	ERR_FAIL_COND(p_depth < 0.001);
	depth = p_depth;
	_make_dirty();
	update_gizmos();
}
float CSGPolygon3D::get_depth() const {
	return depth;
}
void CSGPolygon3D::set_path_continuous_u(bool p_enable) {
	path_continuous_u = p_enable;
	_make_dirty();
}
bool CSGPolygon3D::is_path_continuous_u() const {
	return path_continuous_u;
}
void CSGPolygon3D::set_path_u_distance(real_t p_path_u_distance) {
	path_u_distance = p_path_u_distance;
	_make_dirty();
	update_gizmos();
}
real_t CSGPolygon3D::get_path_u_distance() const {