I know it's a bit too late, but it is possible to access shadow-root (closed) if it is not placed in cross origin iframe (in your case it is not placed).
Since Selenium implemented CDP protocol API, you can override Element class prototype method attachShadow and evaluate script on new document before page load.
So when shadow-root node would be attached in page context, it would be automatically created with status open.
However, if shadow-root (closed) is placed inside iframe from resource you are not controlling, override iframeElement.contentWindow.Element would be impossible because of CORS.
How to override Element properties
How to executed script on load via CDP Protocol
Solution without workaround for your case:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
wait = WebDriverWait(driver, 10)
url = "https://www.sreality.cz/hledani/prodej/domy"
driver.execute_cdp_cmd('Page.addScriptToEvaluateOnNewDocument', {'source': """
Element.prototype._attachShadow = Element.prototype.attachShadow;
Element.prototype.attachShadow = function () {
return this._attachShadow( { mode: "open" } );
};
"""})
driver.get(url)
closed_shadow_host = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, '.szn-cmp-dialog-container')))
shadow_root = driver.execute_script('return arguments[0].shadowRoot', closed_shadow_host)
button = shadow_root.find_element(By.CSS_SELECTOR, "button[data-testid='button-agree']")
button.click()