update_post_meta

I don’t think you’re actually getting the post ID sent by the javascript.

function toggle_task_status () {
    $post_id = $_POST['data']['post_id'];
    $update = update_post_meta($post_id , 'task_status', 'open');
    if($update){
        wp_send_json('success');
    } else {
        wp_send_json('fail');
    }
    wp_die();
}

and then in your javascript

success: function (response) {
    console.log(response); // should be either 'success'  or 'fail'
}

error code: 523