wp_redirect not working from shortcode function

Why does it need to be a Shortcode? Looks like a XY Problem.

You’re already inserting the shortcode manually in the edit screen. Use a Custom Field instead and hook earlier where you can actually do the redirect.

enter image description here

add_action( 'template_redirect', function(){
    global $post;
    $redirect = get_post_meta( $post->ID, 'redirect', true );
    if( $redirect )
    {
        wp_redirect( admin_url( 'profile.php' ) );
        exit;
    }
});

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)