### 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
HashMap<ObjectID, List<Pair<StringName, Variant>>> &map = to_reload[scr];
			while (scr->instances.front()) {
				Object *obj = scr->instances.front()->get();
				
				List<Pair<StringName, Variant>> state;
				if (obj->get_script_instance()) {
					obj->get_script_instance()->get_property_state(state);
					map[obj->get_instance_id()] = state;
					obj->set_script(Variant());
				}
			}
#ifdef TOOLS_ENABLED
			while (scr->placeholders.size()) {
				Object *obj = (*scr->placeholders.begin())->get_owner();
				
				if (obj->get_script_instance()) {
					map.insert(obj->get_instance_id(), List<Pair<StringName, Variant>>());
					List<Pair<StringName, Variant>> &state = map[obj->get_instance_id()];
					obj->get_script_instance()->get_property_state(state);
					obj->set_script(Variant());
				} else {
					
					scr->placeholders.erase(*scr->placeholders.begin());
				}
			}
#endif
			for (const KeyValue<ObjectID, List<Pair<StringName, Variant>>> &F : scr->pending_reload_state) {
				map[F.key] = F.value; 
			}