### 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
} break;
				default:
					
					break;
			}
		}
		if (suite->parent_if && suite->parent_if->condition && suite->parent_if->condition->type == GDScriptParser::Node::TYPE_TEST) {
			
			
			
			
			const GDScriptParser::TypeTestNode *type_test = static_cast<const GDScriptParser::TypeTestNode *>(suite->parent_if->condition);
			if (type_test->operand && type_test->test_type && type_test->operand->type == GDScriptParser::Node::IDENTIFIER && static_cast<const GDScriptParser::IdentifierNode *>(type_test->operand)->name == p_identifier->name && static_cast<const GDScriptParser::IdentifierNode *>(type_test->operand)->source == p_identifier->source) {
				
				GDScriptParser::CompletionContext c = p_context;
				c.current_line = type_test->operand->start_line;
				c.current_suite = suite;
				if (type_test->test_datatype.is_hard_type()) {
					id_type = type_test->test_datatype;
					if (last_assign_line < c.current_line) {
						
						last_assign_line = c.current_line;
						last_assigned_expression = nullptr;
					}
				}
			}
		}
		suite = suite->parent_block;
	}
	if (last_assigned_expression && last_assign_line < p_context.current_line) {