### Godot version

v4.1.2.stable.flathub [399c9dc39]

### System information

Godot v4.1.2.stable (399c9dc39) - Freedesktop SDK 23.08 (Flatpak runtime) - Wayland - Vulkan (Compatibility) - NVIDIA GeForce GTX 1050 Ti with Max-Q Design () - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 Threads)

### Issue description

When creating curved Path3Ds and using the Option `Debug > Visible Paths` they don't show up curved and instead are just straight lines.
Source Code: https://github.com/Arbee4ever/Train-Game/blob/master/scripts/World.gd#L115

### Steps to reproduce

1. Create Script to create curved Path3D
2. enable `Debug > Visible Paths`
3. run game
4. see straight line instead of curve

### Minimal reproduction project

N/A
RS::get_singleton()->mesh_surface_set_material(debug_mesh->get_rid(), 0, st->get_debug_paths_material()->get_rid());
	if (is_inside_tree()) {
		RS::get_singleton()->instance_set_scenario(debug_instance, get_world_3d()->get_scenario());
		RS::get_singleton()->instance_set_transform(debug_instance, get_global_transform());
		RS::get_singleton()->instance_set_visible(debug_instance, is_visible_in_tree());
	}
}
void Path3D::_curve_changed() {
	if (is_inside_tree() && Engine::get_singleton()->is_editor_hint()) {
		update_gizmos();
	}
	if (is_inside_tree()) {
		emit_signal(SNAME("curve_changed"));
	}
	
	
	if (is_inside_tree()) {
		for (int i = 0; i < get_child_count(); i++) {
			PathFollow3D *child = Object::cast_to<PathFollow3D>(get_child(i));
			if (child) {
				child->update_configuration_warnings();
			}
		}
	}
	SceneTree *st = SceneTree::get_singleton();
	if (st && st->is_debugging_paths_hint()) {
		_update_debug_mesh();
	}
}
void Path3D::set_curve(const Ref<Curve3D> &p_curve) {