When directly closing an unfocused tab with the "X" button, focus is reset to the tab adjacent to the closed tab
When closing an unfocused tab with its "X" button (without intently focusing the tab itself, from a user's point of view), Epiphany switches to the adjacent tab, making you lose the focus of tab you were on, which it should never do.
I presume it invisibly/instantly switches focus to the tab you are attempting to close, and then when it gets closed the focus gets thrown off to the adjacent tab instead of the tab that was previously intentionally focused by the user (issue #2175).
Firefox and Chromium maintain the focus on the current tab when directly closing an unfocused tab with its X button.
Tested with Epiphany 44.6 on Fedora 38's Wayland GNOME session, and with Epiphany TP (45.beta-59-g4f598b1e+)