### Godot version

4.2 (c5da2e54fe50cad34b5f93fa10538978b33af88d)

### System information

Windows 11

### Issue description

Attempting to run a scene with the following script report Identifier not found error:

![image](https://github.com/godotengine/godot/assets/3036176/3a63b930-0588-499d-80a2-4f88f5f07116)

This does not happen on 4.1.1 so this is a regression.

### Steps to reproduce

Create a script derived from Control and try to get access to the mouse_entered signal.

### Minimal reproduction project

[TestBug.zip](https://github.com/godotengine/godot/files/12237764/TestBug.zip)

p_script->member_functions.clear();
	for (const KeyValue<StringName, GDScriptFunction *> &E : member_functions) {
		memdelete(E.value);
	}
	member_functions.clear();
	p_script->static_variables.clear();
	if (p_script->implicit_initializer) {
		memdelete(p_script->implicit_initializer);
	}
	if (p_script->implicit_ready) {
		memdelete(p_script->implicit_ready);
	}
	if (p_script->static_initializer) {
		memdelete(p_script->static_initializer);
	}
	p_script->member_functions.clear();
	p_script->member_indices.clear();
	p_script->member_info.clear();
	p_script->static_variables_indices.clear();
	p_script->static_variables.clear();
	p_script->_signals.clear();
	p_script->initializer = nullptr;
	p_script->implicit_initializer = nullptr;
	p_script->implicit_ready = nullptr;
	p_script->static_initializer = nullptr;
	p_script->clearing = false;
	p_script->tool = parser->is_tool();
	if (!p_script->name.is_empty()) {
		if (ClassDB::class_exists(p_script->name) && ClassDB::is_class_exposed(p_script->name)) {
			_set_error("The class '" + p_script->name + "' shadows a native class", p_class);