### Godot version

4.1.dev

### System information

Win11

### Issue description

I load a non-existing GDScript, but it still returns a valid instance instead of null.
```gdscript
@tool
extends EditorScript

func _run():
	var s = ResourceLoader.load("non_exists.gd", "", ResourceLoader.CACHE_MODE_IGNORE)
	print(s)
	assert(s == null)

```

```
  Attempt to open script 'res://non_exists.gd' resulted in error 'File not found'.
<GDScript#-9223369015982753437>
  res://new_script.gd:7 - Assertion failed.

```

### Steps to reproduce

N/A

### Minimal reproduction project

N/A
singleton->static_gdscript_cache.erase(p_fqcn);
}
Ref<PackedScene> GDScriptCache::get_packed_scene(const String &p_path, Error &r_error, const String &p_owner) {
	MutexLock lock(singleton->mutex);
	if (singleton->packed_scene_cache.has(p_path)) {
		singleton->packed_scene_dependencies[p_path].insert(p_owner);
		return singleton->packed_scene_cache[p_path];
	}
	Ref<PackedScene> scene = ResourceCache::get_ref(p_path);
	if (scene.is_valid()) {
		singleton->packed_scene_cache[p_path] = scene;
		singleton->packed_scene_dependencies[p_path].insert(p_owner);
		return scene;
	}
	scene.instantiate();
	r_error = OK;
	if (p_path.is_empty()) {
		r_error = ERR_FILE_BAD_PATH;
		return scene;
	}
	scene->set_path(p_path);
	singleton->packed_scene_cache[p_path] = scene;
	singleton->packed_scene_dependencies[p_path].insert(p_owner);
	scene->reload_from_file();
	return scene;
}
void GDScriptCache::clear_unreferenced_packed_scenes() {