### 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
SceneTree *st = SceneTree::get_singleton();
	if (!(st && st->is_debugging_paths_hint())) {
		return;
	}
	if (!debug_mesh.is_valid()) {
		debug_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
	}
	if (!(curve.is_valid())) {
		RS::get_singleton()->instance_set_visible(debug_instance, false);
		return;
	}
	if (curve->get_point_count() < 2) {
		RS::get_singleton()->instance_set_visible(debug_instance, false);
		return;
	}
	Vector<Vector3> vertex_array;
	for (int i = 1; i < curve->get_point_count(); i++) {
		Vector3 line_end = curve->get_point_position(i);
		Vector3 line_start = curve->get_point_position(i - 1);
		vertex_array.push_back(line_start);
		vertex_array.push_back(line_end);
	}
	Array mesh_array;
	mesh_array.resize(Mesh::ARRAY_MAX);
	mesh_array[Mesh::ARRAY_VERTEX] = vertex_array;
	debug_mesh->clear_surfaces();
	debug_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, mesh_array);
	RS::get_singleton()->instance_set_base(debug_instance, debug_mesh->get_rid());