In my game_director script I link some scenes to use later:

...
@export var main_menu_scene: PackedScene # THIS IS THE SCENE CAUSING THE PROBLEMS

@export var main_camera: PhantomCamera3D
@export var execution_camera: PhantomCamera3D

@export var levels: Array[Level]

@export var player_scene: PackedScene
@export var enemy_types: Array[PackedScene]
@export var player_ui: PlayerUI

@export var enemy_scenes: Array[PackedScene]

....

I then select all variables in the inspector so everything is set up correctly:

But when I run the game the Debugger yields this warning:

E 0:00:03:0366 _parse_ext_resource: res://Scenes/game_director.tscn:22 - Parse Error: [ext_resource] referenced non-existent resource at: res://Scenes/MainMenu.tscn
<C++ Source> scene/resources/resource_format_text.cpp:163 @ _parse_ext_resource()

And if I try to print the value of main_menu_scene it says it's null. The rest of the exported variables are working correctly. If I try to use the Main Menu scene directly in the code with it's path, it works correctly:

if Input.is_action_just_pressed("Cancel"):
		get_tree().change_scene_to_packed(main_menu_scene) # This doesn't do anything as main_menu_scene is null
		get_tree().change_scene_to_file("res://Scenes/MainMenu.tscn") # This works correctly

What is going on? How can I fix this? I could just work with the path name, but I'd preffer to link the scene in the editor.

BTW, the Main Menu scene works correctly, it's the first scene the game runs and it shows the menu working correctly without any errors.

I think I've located the error: The main menu scene has a reference to the game scene in an exported variable. The game scene has a GameDirector node, which has the reference back to MainMenu which is causing the problems. This seems to create a circular reference that Godot doesn't like, because as soon as I remove one of those 2 references (MainMenu->Game or GameDirector->MainMenu) everything works fine.