Loading comments in ajax – comment-reply function missing $args

You do not need an existing $args variable here, you can define your own arguments and they will override the defaults. See the get_comment_reply_link() docs for the defaults.

Instead, you can pass the arguments you want directly.

    comment_reply_link( array(
        'reply_text' => __( 'Répondre ', 'autourdesanimaux' ),
        'depth'      => $depth,
        'max_depth'  => get_option( 'thread_comments_depth' )
    ) );

The $depth variable will need to be set, and it needs to be greater than zero and less than max_depth. This article describes how to get a comment’s depth by checking for the parent property on WP_Comment objects and counting.

error code: 523