### Godot version

4.0-beta12

### System information

Windows11 Vulkan API 1.2.0 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1080

### Issue description

Can not assign "SpriteFrames" resource file to SpriteFrames attribute in custom resource file, it alert "Recursion detected, unable to assign resource to property."


### Steps to reproduce

Please look uploaded project. try assign new_sprite_frames.tres to frames in custom_res.tres.

### Minimal reproduction project

[GodotCustomRes.zip](https://github.com/godotengine/godot/files/10419770/GodotCustomRes.zip)

if (!scene_tree) {
		scene_tree = memnew(SceneTreeDialog);
		scene_tree->get_scene_tree()->set_show_enabled_subscene(true);
		scene_tree->get_scene_tree()->set_valid_types(valid_types);
		add_child(scene_tree);
		scene_tree->connect("selected", callable_mp(this, &EditorPropertyNodePath::_node_selected));
	}
	scene_tree->popup_scenetree_dialog();
}
void EditorPropertyNodePath::_node_clear() {
	if (pointer_mode) {
		emit_changed(_get_meta_pointer_property(), NodePath());
	} else {
		emit_changed(get_edited_property(), NodePath());
	}
	update_property();
}
bool EditorPropertyNodePath::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
	return !is_read_only() && is_drop_valid(p_data);
}
void EditorPropertyNodePath::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
	ERR_FAIL_COND(!is_drop_valid(p_data));
	Dictionary data_dict = p_data;
	Array nodes = data_dict["nodes"];
	Node *node = get_tree()->get_edited_scene_root()->get_node(nodes[0]);
	if (node) {
		_node_selected(node->get_path());
	}
}
bool EditorPropertyNodePath::is_drop_valid(const Dictionary &p_drag_data) const {