### Godot version

4.0.2.stable

### System information

Windows 10

### Issue description

Engine keeps spamming me this
![изображение](https://user-images.githubusercontent.com/89089095/232018878-1584ed55-5867-4883-9519-67b82ef93813.png)


### Steps to reproduce

No steps, issue happens from time to time absolutely randomly

### Minimal reproduction project

N/A
EnumNode *enum_node = alloc_node<EnumNode>();
	bool named = false;
	if (check(GDScriptTokenizer::Token::IDENTIFIER)) {
		advance();
		enum_node->identifier = parse_identifier();
		named = true;
	}
	push_multiline(true);
	consume(GDScriptTokenizer::Token::BRACE_OPEN, vformat(R"(Expected "{" after %s.)", named ? "enum name" : R"("enum")"));
	HashMap<StringName, int> elements;
#ifdef DEBUG_ENABLED
	List<MethodInfo> gdscript_funcs;
	GDScriptLanguage::get_singleton()->get_public_functions(&gdscript_funcs);
#endif
	do {
		if (check(GDScriptTokenizer::Token::BRACE_CLOSE)) {
			break; 
		}
		if (consume(GDScriptTokenizer::Token::IDENTIFIER, R"(Expected identifier for enum key.)")) {
			EnumNode::Value item;
			GDScriptParser::IdentifierNode *identifier = parse_identifier();
#ifdef DEBUG_ENABLED
			if (!named) { 
				for (MethodInfo &info : gdscript_funcs) {