Welcome to the forums @LacoPT!
There is no great way to do in through script, but I recently had to figure this out in C++ so I know it's doable. Here's the code, translated to GDScript (untested though):
func _reparent_node(node_to_reparent, new_parent):
var old_parent = node_to_reparent.get_parent()
old_parent.remove_child(node_to_reparent)
new_parent.add_child(node_to_reparent)
_set_owner_for_node_and_children(node_to_reparent, new_parent.get_owner())
func _set_owner_for_node_and_children(node, owner):
node.set_owner(owner)
for child_node in node.get_children():
_set_owner_for_node_and_children(child_node, owner)
The gist of it is that you need to remove the node from it's old parent and add it to the new parent.
Then you need to make sure all of the nodes have the correct owners, so they don't disappear from the scene tree. This is probably an optional step, since it only occurs if the node you are re-parenting to was created via script, but for my needs it was required, so I thought I'd add it here.