### 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
}
					base_type = base_type.class_type->base_type;
					break;
				case GDScriptParser::DataType::NATIVE: {
					if (id_type.is_set() && !id_type.is_variant()) {
						base_type = GDScriptParser::DataType();
						break;
					}
					MethodInfo info;
					if (ClassDB::get_method_info(base_type.native_type, p_context.current_function->identifier->name, &info)) {
						for (const PropertyInfo &E : info.arguments) {
							if (E.name == p_identifier->name) {
								r_type = _type_from_property(E);
								return true;
							}
						}
					}
					base_type = GDScriptParser::DataType();
				} break;
				default:
					break;
			}
		}
	}
	if (id_type.is_set() && !id_type.is_variant()) {
		r_type.type = id_type;
		return true;
	}
	
	if (p_context.current_class) {