### Godot version

4.1 Stable

### System information

MacBook Ventura 13.4

### Issue description

Undo/Redo manager `history_changed` events stop being emitted when clicking on the same editor inspector property. This also stops creating Undo/Redo events, so "undo" actions stop working.

### Steps to reproduce

The steps to reproduce is kind of finnicky, but I was able to reproduce it with relative easy using the "position" propert:

- Click "Y" position and change it to any value; press Enter.
- Click the "Y" position again and change it to any value; press Enter.
- Click the "Y" position again (again), and change it to any value; press Enter.

On the third time changing the value, "history_changed" events stop being emitted. Checking the "History" tab, you'll see only the two events are logged (other changes in the position are not).



### Minimal reproduction project

This can be reproduced in any project, but I'm attaching a project with an addon that logs a "history_changed" event on the console so you know when it stops being emitted.
[HistoryIssue.zip](https://github.com/godotengine/godot/files/12053128/HistoryIssue.zip)

ERR_FAIL_COND_V(!history_map.has(p_idx), nullptr);
	return history_map[p_idx].undo_redo;
}
int EditorUndoRedoManager::get_history_id_for_object(Object *p_object) const {
	int history_id = INVALID_HISTORY;
	if (Object::cast_to<EditorDebuggerRemoteObject>(p_object)) {
		return REMOTE_HISTORY;
	}
	if (Node *node = Object::cast_to<Node>(p_object)) {
		Node *edited_scene = EditorNode::get_singleton()->get_edited_scene();
		if (edited_scene && (node == edited_scene || edited_scene->is_ancestor_of(node))) {
			int idx = EditorNode::get_singleton()->get_editor_data().get_current_edited_scene_history_id();
			if (idx > 0) {
				history_id = idx;
			}
		}
	}
	if (Resource *res = Object::cast_to<Resource>(p_object)) {
		if (res->is_built_in()) {
			if (res->get_path().is_empty()) {
				int idx = EditorNode::get_singleton()->get_editor_data().get_current_edited_scene_history_id();
				if (idx > 0) {