Draft preview opens in error

when i route my website to exclude “works/” in the url, the draft preview sends me to the right link (siteurl/link without works?token=…) but it displays an error page. i don’t have that issue with pages that are not children of works.
here is my routing:

'routes' => [
        [
            'pattern' => 'works/(:all)',
            'action'  => function($uid) {
                go($uid);
            }
        ],
        [
            'pattern' => '(:all)',
            'action'  => function($uid) {
                
                $page = page($uid);

                if(!$page) $page = page('works/' . $uid);
                if ($page) {
                  return site()->visit($page);
                }
               $this->next();
            }
        ],
    ],

i know this issue has come up before but i was not able to find a solution that worked for me.

The page() helper does not fetch drafts, you need to use kirby()->page($uid) instead, see page() | Kirby CMS