### Godot version

4.0 8a98110

### System information

Windows 10 x64

### Issue description

I have a method call in my script that has changed in some newer version. Whenever I want to open the project in the new version, the autoload script will spam argument error. Forever.

https://user-images.githubusercontent.com/2223172/210169561-1938b0f9-684e-4a8f-bebd-4900ff48b98a.mp4

The project never loads. It works fine after I fix the method in external editor.

### Steps to reproduce

1. Be me
2. Try to open the project :<

### Minimal reproduction project

I wasn't able to reproduce it in a minimal project. I suspect some dependency being at fault.
MutexLock lock(singleton->mutex);
	if (singleton->full_gdscript_cache.has(p_path)) {
		return singleton->full_gdscript_cache[p_path];
	}
	if (singleton->shallow_gdscript_cache.has(p_path)) {
		return singleton->shallow_gdscript_cache[p_path];
	}
	return Ref<GDScript>();
}
Error GDScriptCache::finish_compiling(const String &p_owner) {
	MutexLock lock(singleton->mutex);
	
	Ref<GDScript> script = get_cached_script(p_owner);
	singleton->full_gdscript_cache[p_owner] = script;
	singleton->shallow_gdscript_cache.erase(p_owner);
	HashSet<String> depends = singleton->dependencies[p_owner];
	Error err = OK;
	for (const String &E : depends) {
		Error this_err = OK;
		
		get_full_script(E, this_err);
		if (this_err != OK) {
			err = this_err;
		}
	}
	singleton->dependencies.erase(p_owner);
	return err;
}
Ref<PackedScene> GDScriptCache::get_packed_scene(const String &p_path, Error &r_error, const String &p_owner) {