This often happens to me.
And it has been bugging me for years.
I have this issue in Vivaldi and in Firefox.
When I use a small relationship editor popup (pencil icon) in which I want to replace an entity by another.
I paste the new entity URL and it finds it (green).
> uncaught exception: entity not in the entities array
As the popup is still there, I press ENTER again to confirm/close it (another bug in Firefox is that popups reopen, but it is because of some user script).
It closes, the relationship got span.rel-edit (equivalent of span.mp) to show it's modified but the content is still the old entity.
If I submit the form, the edit is correct, so it is "only" a display issue.
For example you can reproduce by editing any Lyrics URL and selecting any other work in the pencil popup. https://musicbrainz.org/url/087962c6-6836-471b-a07a-33f4ab9f7a15