How to know if the most recent article

Sounds like WordPress does not support this out of the box. However, you can get the most recent post via wp_get_recent_posts(), and then check against the result from there.

Here I am using array_shift() to turn the array containing one post into the post itself.

$args = array(
    'numberposts' => 1,
    'post_status' => 'publish',
);
$most_recent_post = array_shift(wp_get_recent_posts( $args, ARRAY_A ));

$next_post = get_next_post();
if (!empty( $next_post )) {
    // is the next post the most recent post?
    if ($most_recent_post['ID'] === $next_post->ID) {
        // next post is most recent post
    } else {
        // next post is not most recent post
    }
}

error code: 523