### 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
ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "new", &GDScript::_new, MethodInfo("new"));
	ClassDB::bind_method(D_METHOD("get_as_byte_code"), &GDScript::get_as_byte_code);
}
Vector<uint8_t> GDScript::get_as_byte_code() const {
	return Vector<uint8_t>();
};
Error GDScript::load_byte_code(const String &p_path) {
	return ERR_COMPILATION_FAILED;
}
void GDScript::set_path(const String &p_path, bool p_take_over) {
	String old_path = path;
	if (is_root_script()) {
		Script::set_path(p_path, p_take_over);
	}
	this->path = p_path;
	GDScriptCache::move_script(old_path, p_path);
	for (KeyValue<StringName, Ref<GDScript>> &kv : subclasses) {
		kv.value->set_path(p_path, p_take_over);
	}
}
String GDScript::get_script_path() const {
	return path;
}
Error GDScript::load_source_code(const String &p_path) {
	if (p_path.is_empty() || ResourceLoader::get_resource_type(p_path.get_slice("::", 0)) == "PackedScene") {
		return OK;
	}
	Vector<uint8_t> sourcef;
	Error err;