### Godot version

4.1.1

### System information

windows 11

### Issue description

When registering a type with class_name and using that class name to declare a variable in code only, autocomplete works as expected anywhere in other nodes/scenes. However, if making a custom scene node that extends a script with the class_name, if that custom scene is instantiated in a different scene, even if the type is specified, it only shows the parent node's functions and not any of the extended functionality. I have made a basic project showing the issue

### Steps to reproduce

I have made a very simple project showing the issue. https://github.com/mmmmmmmmmmmmmmmmmmmdonuts/godot_4_autocomplete_issue essentially, the extended Node scene will only show the custom function when both the type is specified as well as the type afterwards following "as" 
e.g. `@onready var my_class_4: MyClass = $MyClass4 as MyClass`

### Minimal reproduction project

https://github.com/mmmmmmmmmmmmmmmmmmmdonuts/godot_4_autocomplete_issue
const GDScriptParser::AnnotationNode *annotation = static_cast<const GDScriptParser::AnnotationNode *>(completion_context.node);
			_find_annotation_arguments(annotation, completion_context.current_argument, quote_style, options);
			r_forced = true;
		} break;
		case GDScriptParser::COMPLETION_BUILT_IN_TYPE_CONSTANT_OR_STATIC_METHOD: {
			
			{
				List<StringName> constants;
				Variant::get_constants_for_type(completion_context.builtin_type, &constants);
				for (const StringName &E : constants) {
					ScriptLanguage::CodeCompletionOption option(E, ScriptLanguage::CODE_COMPLETION_KIND_CONSTANT);
					bool valid = false;
					Variant default_value = Variant::get_constant_value(completion_context.builtin_type, E, &valid);
					if (valid) {
						option.default_value = default_value;
					}
					options.insert(option.display, option);
				}
			}
			
			{
				List<StringName> methods;
				Variant::get_builtin_method_list(completion_context.builtin_type, &methods);
				for (const StringName &E : methods) {
					if (Variant::is_builtin_method_static(completion_context.builtin_type, E)) {
						ScriptLanguage::CodeCompletionOption option(E, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION);
						if (Variant::get_builtin_method_argument_count(completion_context.builtin_type, E) > 0 || Variant::is_builtin_method_vararg(completion_context.builtin_type, E)) {
							option.insert_text += "(";
						} else {
							option.insert_text += "()";