changing parent_id on post

In order to make it working you need to return updated data:

function my_insert_post_data($data, $postarr){
    $data["post_parent"] = 123;
    $postarr["parent_id"] = 123;
    $postarr["post_parent"] = 123;

    error_log(print_r($data,true));
    error_log(print_r($postarr,true));

    return $data;
}
add_filter( 'wp_insert_post_data' , 'my_insert_post_data' , 99, 2 );