No it shouldn’t, middlemouse should always override the keyboard focus.
But if there is a bug in the focus control, this routine is the first logical one to look into and see if toggeling it makes a difference for starters.
And if this seems to be the culprit, then how to reproduce it.