### Godot version

v4.0.beta.custom_build [fab9926a9]

### System information

Fedora 37

### Issue description

When creating a new inherited scene, saving the scene (for example with Ctrl+S) defaults to overwriting the scene being inherited, instead of prompting for a location to save to.

### Steps to reproduce

1. Create a new inherited scene
2. Press Ctrl+S

If the scene being inherited is imported (for example from a glTF), an error displays. If the inherited scene is a .tscn or .scn, it gets overridden by an inherited scene that tries to inherit itself, which is impossible and thus corrupt.

### Minimal reproduction project

N/A
ERR_FAIL_COND_V(!p_object || !gui_base, nullptr);
	Ref<Script> scr = p_object->get_script();
	if (scr.is_null() && p_object->is_class("Script")) {
		scr = p_object;
	}
	if (scr.is_valid() && !script_icon_cache.has(scr)) {
		Ref<Script> base_scr = scr;
		while (base_scr.is_valid()) {
			StringName name = EditorNode::get_editor_data().script_class_get_name(base_scr->get_path());
			String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(name);
			Ref<ImageTexture> icon = _load_custom_class_icon(icon_path);
			if (icon.is_valid()) {
				script_icon_cache[scr] = icon;
				return icon;
			}