### 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 (p_drag_data["type"] != "nodes") {
		return false;
	}
	Array nodes = p_drag_data["nodes"];
	if (nodes.size() != 1) {
		return false;
	}
	Node *dropped_node = get_tree()->get_edited_scene_root()->get_node(nodes[0]);
	ERR_FAIL_NULL_V(dropped_node, false);
	if (valid_types.is_empty()) {
		
		return true;
	}
	for (const StringName &E : valid_types) {
		if (dropped_node->is_class(E) ||
				EditorNode::get_singleton()->is_object_of_custom_type(dropped_node, E)) {
			return true;
		}
	}
	return false;
}
void EditorPropertyNodePath::update_property() {