### Godot version

v4.2.dev3.mono.official [013e8e3af]

### System information

Godot v4.2.dev3.mono - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 Ti Laptop GPU (NVIDIA; 31.0.15.3598) - AMD Ryzen 7 5800H with Radeon Graphics (16 Threads)

### Issue description

When creating and attaching a built-in script to any type of node, trying to drag nodes from the scene-tree results in an error that appears at the bottom-right of the editor, but not in the console window. The error states:

`Can't drop nodes because script 'xxxxxxxx::xxxxxxx' does not inherit Node.`
 Even though the script clearly extends Node or any other type.

### Steps to reproduce

1. Create and add any node type to the scene tree.
2. Attach a new script, choose Built-in from the dialog.
3. Save the scene first, as at the time of writing, Godot suffers from a bug that causes it to crash if the scene was not saved first.
4. Try dragging or even ctrl-dragging a node to the script.
5. Observe the error appear at the bottom-right in a yellow-accent pop-up.
6. Nod and confirm that the bug exists.


### Minimal reproduction project

[can't drag nodes into built-in scripts.zip](https://github.com/godotengine/godot/files/12511196/can.t.drag.nodes.into.built-in.scripts.zip)

Loose files in the archive. Extract into their own folder.
use_templates->set_pressed(is_using_templates);
	use_templates->connect("pressed", callable_mp(this, &ScriptCreateDialog::_use_template_pressed));
	template_hb->add_child(use_templates);
	template_inactive_message = "";
	template_menu = memnew(OptionButton);
	template_menu->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	template_menu->connect("item_selected", callable_mp(this, &ScriptCreateDialog::_template_changed));
	template_hb->add_child(template_menu);
	gc->add_child(template_hb);
	/* 
	internal = memnew(CheckBox);
	internal->set_text(TTR("On"));
	internal->connect("pressed", callable_mp(this, &ScriptCreateDialog::_built_in_pressed));
	gc->add_child(memnew(Label(TTR("Built-in Script:"))));
	gc->add_child(internal);
	/* 
	hb = memnew(HBoxContainer);
	hb->connect("sort_children", callable_mp(this, &ScriptCreateDialog::_path_hbox_sorted));
	file_path = memnew(LineEdit);
	file_path->connect("text_changed", callable_mp(this, &ScriptCreateDialog::_path_changed));
	file_path->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	hb->add_child(file_path);
	path_button = memnew(Button);
	path_button->connect("pressed", callable_mp(this, &ScriptCreateDialog::_browse_path).bind(false, true));
	hb->add_child(path_button);
	Label *label = memnew(Label(TTR("Path:")));
	gc->add_child(label);
	gc->add_child(hb);
	path_controls[0] = label;
	path_controls[1] = hb;