In the gif bellow I've tried to click on the search box, but focus goes to the "Show flyout" button instead, so I have to click the search box a second time.

@cjcenizal please assign me this issue
@anishagg17 We've decided that we won't "assign" issues to community members any longer but just by commenting that you will be taking the issue should be enough to discourage conflicts with others. 馃憤
Also, just a reminder. You have a dozen open PRs at the moment. Please don't make any new ones until those ones are resolved.
Seems like there's a bug with ownFocus where all flyouts seems to have ownFocus set on them.
When fixing this issue, I wonder if we could make that the official default as no one has seemed to have complained about this bug ever so I'm guessing no one noticed.
I think this is also related to #3170
Update: I thought that this issue had been resolved by #4236 (and merely not closed), but elastic/kibana#87517 shows otherwise.
Oddly, only Chromium browsers display this behavior (Firefox and Safari do not attempt to return focus). My initial read is that something perhaps changed in a recent Chromium update, but I haven't verified.
I don't have a definite answer but the fact that it only happens in Chromium makes me think it might have something to do with the way browser's handle losing a reference to the currently focused element which Chromium does differently than Firefox and Safari (Chromium tries to do more magic).
I couldn't find any info on this changing recently however... (Seem to have been implemented in FF+Safari in 2013 and Chromium in 2016. Went so far as to check Chromium source and it seems this function hasn't been touched since 2018.)
For further reference if someone else wants to dig into this hypothesis: