Can_process: Condition "!is_inside_tree()" is true. Returning: false

When I use TouchScreenButton’s released signal to switch scenes, it throws can_process: Condition ‘!is_inside_tree()’ is true. returning: false

its often happen if something addresses nodes when something is done during
static func _static_init()
func _init()

or you just not added a node using add_child()
node left orphan and its not in scene tree

No, this error only occurs with the released signal and not with the pressed signal.

idk what happens during pressed state, no code provided. But seems something unrefenced/freed/reparented during its state AND cannot be found when button is released

There is only one line of code in there get_tree().change_scene_to_file(path).I found the solution to the problem, I need to add a line of code await get_tree().create_timer(1).timeout

you don’t have to wait for a second
just try to wait
await RenderingServer.frame_post_draw
its called almost at the end of frame
when everything already processed
or await 2 times to skip one frame

await RenderingServer.frame_post_draw
await RenderingServer.frame_post_draw

Currently solved using call_deferred. But I tried your method and it works. The root of the problem is why it’s not possible in the RELEASED method body to immediately get_tree().change_scene_to_file