When we delete a node, the tree-path still contains the path of deleted node i.e. Null and not the newly-focused node i.e. Number in our case.

Edit: Also noticed a similar behaviour when we undo from the top bar.
Thanks for reporting. I've partially fixed it. Still have to fix it for undo/redo and dragging
I, on the other hand, tried to fix this part (undo/redo/dragging still pending, but this particular one works) with following change somewhere around the following line: https://github.com/josdejong/jsoneditor/blob/b45993ccd56f76b1f9eb412672dba871f4869eb0/src/js/Node.js#L3395
editor._updateTreePath(this.getNodeFromTarget(editor.focusTarget).getNodePath());
Not sure if this helps, sharing anyway
@tanmayrajani with my fix in should work now for the remove action with this fix https://github.com/josdejong/jsoneditor/commit/37e609d4d8b5997ff77cf08bcfc92f6b1223447b. I try to solve it at a single place where it works for any action and any change in selection but for undo/redo it's a bit tricky to figure out.
I found the cause, this.selection wasn't up to date right after an action was executed, and my solution to update the treepath was based on that. The tree path should now work for all actions and for undo/redo too in the just published v5.25.0.