I’ve found that, when using Safari/MacOS it is not possible to share a specific window. All I can do is share an entire display, which seems to be the display where the browser window is, so the result is the infinite window-within-window effect. If I use Firefox I get presented with a list of displays and application windows that I can select from.
Safari has only recently got the screensharing functionality that BBB is using in Version 13. My bet would be that Safari just has no UI/function to select a window and only supports sharing the whole screen.