This has been driving me absolutely insane. This happens with both firefox and chrome.
Example I just had happen: I have a window open that I am working on in firefox. I open the extension window to begin recording from that window. I press record. It grabs another window I had open with google sheets in the background and starts recording that. Why?
Or on chrome: I had two windows open, one would launch the second for me to work on. I start running the macro and it is erroring out. Why? Because it was trying to run the macro on the window that I had in the background.
The worst part is how inconsistent it is. I tried twice in the first firefox example. The first time I was able to successfully complete a recording. When I tried the second time IN THE SAME PAGE it would only focus on the other google sheets window. Nothing had changed - same windows, same URl, etc. The only difference was that I had input some things in the google sheet (with the frontend closed) and then went back to the window I was working on and opened the frontend again from that window by clicking on the extension.
The only way I can get it to work consistently is by using a dedicated portable version of chrome and only having one window open at a time.
Edit: Looks like the chrome version has been updated to show which window was in focus, which is a nice addition and definitely helps. Firefox is just behind on updates.