How to separate environment in Compositor without black cutouts
I was just curious :)
Because render View Layers doubles rendering if I'm right.

You can use existing setup, just ...

add Set Alpha node and plug inverted Alpha to create transparency in BG
and use InPaint node to recreate missing environment

Note:
because of alpha antialiased edge, I added Delete/Erode node with value -1 to get rid of one pixel that did InPaint node job slightly darker