### Godot version

4.2 f5696c3

### System information

Windows 10 x64

### Issue description

![image](https://github.com/godotengine/godot/assets/2223172/7ad0e3b6-9599-4f7b-a07c-da54779e647a)


### Steps to reproduce

1. Add node
2. Attach a built-in script
3. Add child node
4. Add script to the child node
5. In some method write `get_parent().bui`

### Minimal reproduction project

N/A
int line = scr->get_member_line(p_symbol);
					if (line >= 0) {
						r_result.type = ScriptLanguage::LOOKUP_RESULT_SCRIPT_LOCATION;
						r_result.location = line;
						r_result.script = scr;
						return OK;
					}
					Ref<Script> base_script = scr->get_base_script();
					if (base_script.is_valid()) {
						base_type.script_type = base_script;
					} else {
						base_type.kind = GDScriptParser::DataType::NATIVE;
						base_type.builtin_type = Variant::OBJECT;
						base_type.native_type = scr->get_instance_base_type();
					}
				} else {
					base_type.kind = GDScriptParser::DataType::UNRESOLVED;
				}
			} break;
			case GDScriptParser::DataType::NATIVE: {
				StringName class_name = base_type.native_type;
				if (!ClassDB::class_exists(class_name)) {
					base_type.kind = GDScriptParser::DataType::UNRESOLVED;
					break;
				}
				if (ClassDB::has_method(class_name, p_symbol, true)) {
					r_result.type = ScriptLanguage::LOOKUP_RESULT_CLASS_METHOD;
					r_result.class_name = base_type.native_type;
					r_result.class_member = p_symbol;
					return OK;