### 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)

Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
	int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
	return Vector2(0, font->get_height(font_size) * 3);
}
void EditorPropertyLayersGrid::set_read_only(bool p_read_only) {
	read_only = p_read_only;
}
Size2 EditorPropertyLayersGrid::get_minimum_size() const {
	Size2 min_size = get_grid_size();
	
	if (expanded) {
		const int bsize = (min_size.height * 80 / 100) / 2;
		for (int i = 0; i < expansion_rows; ++i) {
			min_size.y += 2 * (bsize + 1) + 3;
		}
	}
	return min_size;
}
String EditorPropertyLayersGrid::get_tooltip(const Point2 &p_pos) const {
	for (int i = 0; i < flag_rects.size(); i++) {
		if (i < tooltips.size() && flag_rects[i].has_point(p_pos)) {
			return tooltips[i];
		}
	}
	return String();
}
void EditorPropertyLayersGrid::gui_input(const Ref<InputEvent> &p_ev) {