I know if this is not possible if Finder is the front app at the start of your sequence. It is quite common practice that if you close the foremost window in any app, the next one behind it will focus.
But if the Finder is not the foremost app then Cmd . Clicking on the red dot closes the window without bringing the Finder to the front.
There are some Cmd + action features that will work on a window without bringing it to the front – you can drag the window edges to resize, minimize, close, etc.
You can sort of " fake "what you want if you click on the desktop first, then when you close your first window, the desktop itself will be" frontmost & # 39; … but of course it won't really move.