### Godot version

4.0.beta10

### System information

Windows 11

### Issue description
UPDATE: This problem only occurs when the source code contains inner classes

Before 4.0.Beta9, I could get a GDScript instance by `GDScript.new()` and then set the `source_code` property and then `reload()`, but now it throws an error 
```
USER SCRIPT ERROR: Parse Error: Could not find script "".
   at: GDScript::reload (built-in:1644)
```
In my software, I use the above method when the user modifies the code text, and then read the godot log to implement real-time error checking of the custom user script editor. But now this functionality is completely broken

### Steps to reproduce

1. Create a GDScript instance by `GDScript.new()`
2. set the `source_code` property and then `reload()`

### Minimal reproduction project

N/A
if (reloading) {
		return OK;
	}
	reloading = true;
	bool has_instances;
	{
		MutexLock lock(GDScriptLanguage::singleton->mutex);
		has_instances = instances.size();
	}
	ERR_FAIL_COND_V(!p_keep_state && has_instances, ERR_ALREADY_IN_USE);
	String basedir = path;
	if (basedir.is_empty()) {
		basedir = get_path();
	}
	if (!basedir.is_empty()) {
		basedir = basedir.get_base_dir();
	}
	
#ifdef TOOLS_ENABLED
	if (EditorPaths::get_singleton() && basedir.begins_with(EditorPaths::get_singleton()->get_project_script_templates_dir())) {
		reloading = false;
		return OK;
	}
#endif
	{
		String source_path = path;
		if (source_path.is_empty()) {
			source_path = get_path();
		}