I have a problem with reloading

In the game you have a node3d base and a pathfollow3d and a current health variable and when the variable is lower then 1 then reload current scene but it gives an error

here is the pathfollow3d:

extends PathFollow3D

@export var speed : float = 2.5
@onready var base : Node3D = get_tree().get_first_node_in_group(‘base’)

func _ready() → void:
pass # Replace with function body.s

func _process(delta: float) → void:
progress += delta*speed
if progress_ratio == 1.0:
base.take_damage()
set_process(false)

here is the base code:
extends Node3D

@export var max_health : int = 5 #the maximum health of the player
var current_health : int:
set(health_in):
current_health = health_in
health_label.text = 'health: ’ + str(current_health)
if current_health < 1:
get_tree().reload_current_scene()

@onready var health_label: Label3D = $Label3D #the label the health would be presented in

func _ready() → void:
current_health = max_health

func take_damage() → void:
current_health -= 1

And here is the error:
E 0:00:28:0529 get_global_transform: Condition “!is_inside_tree()” is true. Returning: Transform3D()
<C++ Source> scene/3d/node_3d.cpp:324 @ get_global_transform()

I see that sometimes, it shouldnt be a big issue. I suspect that there is some code trying to modify or access a global_transfrorm or global_position while the node3d is not in the tree. I.e. it doesn’t have a global_position.

There “error” says it returns a default transform3d with a zero position.

I would treat this more like a warning.