### Godot version

v4.0.beta11.mono.official [91713ced8]

### System information

Arch Linux, Vulkan, GTX 1060 6GB (525.60.11)

### Issue description

If you set a font property on a theme resource to a certain font resource in the inspector, then set it to another font resource, then set it back to that first font resource again, Godot will refuse to set any font-type property in the theme to that first font.
It will report `Recursion detected, unable to assign resource to property.`. Any attempt to set a font-type property in that theme to that font resource again will fail until you restart the editor. (As far as I've seen.) 
When doing the same thing in code, this does not happen.

### Steps to reproduce

1. Open up a theme resource.
2. Set one of the theme resource's font-type properties to a certain font resource.
3. Set it to another font.
4. Set it to that first font again.
5. Godot refuses! Same thing also happens if you now try to set it to that second font again.

The MRP contains:
* A theme resource.
* Two font resources.
* A scene and script that perform these reproduction steps in code without any issue.
* A text file containing the reproduction steps.

### Minimal reproduction project

[ThemeFontBug-MRP.zip](https://github.com/godotengine/godot/files/10387530/ThemeFontBug-MRP.zip)

} else {
				EditorPropertyText *editor = memnew(EditorPropertyText);
				if (p_hint == PROPERTY_HINT_PLACEHOLDER_TEXT) {
					editor->set_placeholder(p_hint_text);
				} else if (p_hint == PROPERTY_HINT_PASSWORD) {
					editor->set_secret(true);
					editor->set_placeholder(p_hint_text);
				}
				return editor;
			}
		} break;
			
		case Variant::VECTOR2: {
			EditorPropertyVector2 *editor = memnew(EditorPropertyVector2(p_wide));
			EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, default_float_step);
			editor->setup(hint.min, hint.max, hint.step, hint.hide_slider, p_hint == PROPERTY_HINT_LINK, hint.suffix);
			return editor;
		} break;
		case Variant::VECTOR2I: {
			EditorPropertyVector2i *editor = memnew(EditorPropertyVector2i(p_wide));
			EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1);
			editor->setup(hint.min, hint.max, p_hint == PROPERTY_HINT_LINK, hint.suffix);
			return editor;
		} break;
		case Variant::RECT2: {
			EditorPropertyRect2 *editor = memnew(EditorPropertyRect2(p_wide));
			EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, default_float_step);
			editor->setup(hint.min, hint.max, hint.step, hint.hide_slider, hint.suffix);
			return editor;
		} break;