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

CSGBrush *new_brush = memnew(CSGBrush);
	Vector<bool> invert;
	invert.resize(p_vertices.size() / 3);
	{
		int ic = invert.size();
		bool *w = invert.ptrw();
		for (int i = 0; i < ic; i++) {
			w[i] = flip_faces;
		}
	}
	new_brush->build_from_faces(p_vertices, p_uv, p_smooth, p_materials, invert);
	return new_brush;
}
void CSGPrimitive3D::_bind_methods() {
	ClassDB::bind_method(D_METHOD("set_flip_faces", "flip_faces"), &CSGPrimitive3D::set_flip_faces);
	ClassDB::bind_method(D_METHOD("get_flip_faces"), &CSGPrimitive3D::get_flip_faces);
	ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_faces"), "set_flip_faces", "get_flip_faces");
}
void CSGPrimitive3D::set_flip_faces(bool p_invert) {
	if (flip_faces == p_invert) {
		return;
	}
	flip_faces = p_invert;
	_make_dirty();
}
bool CSGPrimitive3D::get_flip_faces() {
	return flip_faces;
}
CSGPrimitive3D::CSGPrimitive3D() {