Do not have his full code but he will need to add some sleep after page load or some other func _WD_WaitElement maybe?. Shadow root main element is maybe defined on page load but its html content is generated later probably on document ready with js/jquery. Some sleep after page load will result in correct selector.
_WD_Navigate($sSession, "https://www.na-kd.com/de")
Sleep(10000)
$sRoot = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "#usercentrics-root")
$sHTML = _WD_ElementAction($sSession, $sRoot, 'property', 'innerHTML')
ConsoleWrite("source: [" & $sHTML & "]" & @CRLF)
$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "button:last-child", $sRoot, Default, True)
_WD_ElementAction($sSession, $sElement, "click")