Turned out that the browser password field used EnableSecureEventInput and so the if the cursor focus was in the password input box, the tab button press would not be detected by my code. I had a piece of code that was looking for the tab keydown event to open the overlay, but in some cases the event was not being triggered. QA reported that on the login screen, you sometimes had to press tab twice to get the overlay to open.
I was getting a game Steam ready and I was working on the Steam overlay that is triggered by the tab key. Yes I once spent a whole day debugging an issue related to this because I was unaware of it.