### Godot version

v4.0.beta16.official

### System information

Windows 7 64-bit

### Issue description

What should happen:
Extensions of custom classes should work with no hassle when a project is imported
What actually happens:
Extensions of custom classes are invalid and must manually be redefined by changing the name and then undoing the change

Why this is an issue:
Sharing a project over git does not include the .godot folder. Something in the folder is what causes these custom class extensions to be registered for your local copy. So without it, these don't apply in the cloned project

### Steps to reproduce

1. First, create a new class. In my example I have created a class called MyClass.
![image](https://user-images.githubusercontent.com/40964335/215239148-4869bae9-0f2f-4df0-af9d-92475b59d3da.png)
2. Then, extend this class.
![image](https://user-images.githubusercontent.com/40964335/215239162-a4f8e751-b4d4-4a16-8d57-8a0139d359c4.png)
3. (Optional) Extend that class again to demonstrate the error
![image](https://user-images.githubusercontent.com/40964335/215239262-c2dd79d6-fb24-4260-85d6-f9d2c407d364.png)

I've put these 3 nodes in a scene, they all work
![image](https://user-images.githubusercontent.com/40964335/215239275-dac6ffb4-b8ec-4241-b1e0-a8c8d26b5015.png)
Classes show up in the node creation menu
![image](https://user-images.githubusercontent.com/40964335/215239298-1918ad80-bc8d-4438-b861-71d2d614dab9.png)

4. Exit the project and delete the .godot folder
![image](https://user-images.githubusercontent.com/40964335/215239395-a740212e-76e1-4e49-aa24-5a73754d8bc8.png)
5. Relaunch the project
Upon relaunching, it'll display this error:
![image](https://user-images.githubusercontent.com/40964335/215239416-16652540-eb45-445f-9583-369b273ccb68.png)

The extension of the custom class is also gone from the node creation scene. It's now invalid.
![image](https://user-images.githubusercontent.com/40964335/215239457-e5b7376f-709d-4539-aed0-912114e4d73f.png)

6. Change the name of the class then remove the name
![image](https://user-images.githubusercontent.com/40964335/215239486-aa422d88-4874-4c64-8544-b12882fe0f73.png)
I added an "H" to the end
![image](https://user-images.githubusercontent.com/40964335/215239504-9e4a61f6-cb21-4e49-810e-d7ff72f2a982.png)
It's returned!
![image](https://user-images.githubusercontent.com/40964335/215239519-fd406332-e112-4c23-bd3f-40fffbbe5934.png)
Upon removing the H, the class returns to how it was before.
It's not that big of a hassle for a single script to go and rename the classes over again and then undo it, but for big projects this can get incredibly irritating.
For example, I recently sent my friend a copy of a project over git. It relies on a lot of custom classes, so when he opened it, he was surprised to find them invalid and had to go and manually alter the names of around 10 classes so he could alter the project. 



### Minimal reproduction project

[CustomClassIssue.zip](https://github.com/godotengine/godot/files/10524420/CustomClassIssue.zip)

if (base_type.kind == GDScriptParser::DataType::CLASS) {
				Ref<GDScript> bf = GDScriptCache::get_full_script(base_type.script_path, err, path);
				if (err == OK) {
					bf = Ref<GDScript>(bf->find_class(base_type.class_type->fqcn));
					if (bf.is_valid()) {
						base_cache = bf;
						bf->inheriters_cache.insert(get_instance_id());
					}
				}
			}
			members_cache.clear();
			member_default_values_cache.clear();
			_signals.clear();
			members_cache.push_back(get_class_category());
			for (int i = 0; i < c->members.size(); i++) {
				const GDScriptParser::ClassNode::Member &member = c->members[i];
				switch (member.type) {
					case GDScriptParser::ClassNode::Member::VARIABLE: {
						if (!member.variable->exported) {
							continue;
						}
						members_cache.push_back(member.variable->export_info);
						Variant default_value = analyzer.make_variable_default_value(member.variable);
						member_default_values_cache[member.variable->identifier->name] = default_value;
					} break;
					case GDScriptParser::ClassNode::Member::SIGNAL: {
						
						Vector<StringName> parameters_names;
						parameters_names.resize(member.signal->parameters.size());
						for (int j = 0; j < member.signal->parameters.size(); j++) {