Reparent node through gdscript

Godot Version 4.1

Question

func _on_object_intteracted(body):
    $main/player.reparent($main/Path3D/PathFollow3D)

I’m trying to reparent a node after interacting with an object. With this code it gives me Cannot call method ‘reparent’ on a null value. What am I doing wrong? Is there a better way? Thanks in advance.

Are you sure that the node paths are correct (be careful with case sensitivity)?

Yes it is. I’ve even tried different things but same error.

It doesn’t find any of the nodes:
Node not found “main/Path3D/PathFollow3D” (relative to “/root/main/Path3D/PathFollow3D”)
Node not found “main/player” (relative to “/root/main/Path3D/PathFollow3D”)

try

func _on_object_intteracted(body):
    $player.reparent($Path3D/PathFollow3D)