Sandboxed macOS app not able to launch the PiP window via Javascript, why?

I have a macOS app which has a WKWebView which can load sites and if they have a video player, it can show the native PiP video window which the app invokes via a Javascript action to the WKWebView. This app is sandboxed for submitted to the Mac app store. The launch of native PiP window works well in the debug version while running from Xcode but not the release version. I want to upload to the Mac App Store, so it has to be sandboxed.

Does the sandboxed app not able to launch the PiP Agent? Or what is missing and why does it works well when running from Xcode in Debug version but not in Release mode as a direct app?

Any help is appreciated.