postActionRedirect - URL updated but the content is still the referrer page

Hi,

I am not quite sure how postActionRedirect works. I expect that this code should redirect me to the Dashboard page. Basically I am testing a this functionality, I have a “Delete Cache Button” button in Admin Menu.

Controller

public function deleteCache(Request $request){
    $postActionVars = [ 'returnUrl'  =>   $this->generateUrl('mautic_dashboard_index')];
    return $this->postActionRedirect(array_merge($postActionVars, [
        'flashes' => $flashes,
    ]));
}

The URL below has been updated to dashboard but the content still in Channels > Email.