### 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
r_type.type.is_meta_type = false;
		r_type.type.is_constant = false;
		return true;
	}
	while (base_type.is_set() && !base_type.is_variant()) {
		switch (base_type.kind) {
			case GDScriptParser::DataType::CLASS:
				if (base_type.class_type->has_function(p_method)) {
					const GDScriptParser::FunctionNode *method = base_type.class_type->get_member(p_method).function;
					if (!is_static || method->is_static) {
						if (method->get_datatype().is_set() && !method->get_datatype().is_variant()) {
							r_type.type = method->get_datatype();
							return true;
						}
						int last_return_line = -1;
						const GDScriptParser::ExpressionNode *last_returned_value = nullptr;
						GDScriptParser::CompletionContext c = p_context;
						c.current_class = base_type.class_type;
						c.current_function = const_cast<GDScriptParser::FunctionNode *>(method);
						c.current_suite = method->body;
						_find_last_return_in_block(c, last_return_line, &last_returned_value);
						if (last_returned_value) {
							c.current_line = c.current_suite->end_line;
							if (_guess_expression_type(c, last_returned_value, r_type)) {
								return true;
							}
						}
					}
				}
				base_type = base_type.class_type->base_type;