Hey Stephan, I had the similar issue with my automation script in ruby. So I used following line of code to resolve the issue. I hope you could get some hint from this command:
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(chrome_options: {detach: true})