After years of just putting up with it, I decided how to automate this process. I was so tired about having so many Finder windows open when I just needed the one in the front so I went here:
and tried out the code. It works, so all one has to do is copy and paste the applescript there and out it in a "execute applescript" KM macro.
tell application "Finder" repeat while window 2 exists close window 2 end repeat end tell
Then I added that macro to the very last StreamDeck button I had empty.
KM is the best.