This isn't decided by the last interaction, it's decided by window enumeration.
By default, an external link will open in the first window opened in a browser. [Last would be more helpful, but that's not how it works.]
The only way to really persuade this to behave is to close all your windows, open one, then move it to the other screen. Then open a second on your main screen.
This behaviour may change after a reboot, when the windows open again. If you find a pattern to this, then it's just easiest to not fight it & move the windows to where you want them visually rather than by the contents of each.