This is because there is no meta key named display_name, so if you want to update a single meta value better use update_user_meta
instead of wp_update_user
, as update_user_meta() will create the meta field if it doesn’t exist.
like
if ( !empty( $_POST['display_name'] ) ) {
update_user_meta( $current_user->ID, 'display_name', esc_attr( $_POST['display_name'] ) );
}
Then you can use the meta key and value the way you want.