### 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
return true;
						case GDScriptParser::ClassNode::Member::GROUP:
							return false; 
						case GDScriptParser::ClassNode::Member::UNDEFINED:
							return false; 
					}
					return false;
				}
				base_type = base_type.class_type->base_type;
				break;
			case GDScriptParser::DataType::SCRIPT: {
				Ref<Script> scr = base_type.script_type;
				if (scr.is_valid()) {
					HashMap<StringName, Variant> constants;
					scr->get_constants(&constants);
					if (constants.has(p_identifier)) {
						r_type = _type_from_variant(constants[p_identifier]);
						return true;
					}
					List<PropertyInfo> members;
					if (is_static) {
						scr->get_property_list(&members);
					} else {
						scr->get_script_property_list(&members);
					}
					for (const PropertyInfo &prop : members) {
						if (prop.name == p_identifier) {
							r_type = _type_from_property(prop);
							return true;
						}