WordPress – Load more posts with AJAX & exclude posts

I made a “load more” button to my website, following this awesome tutorial.
Everything works fine, but in the homepage i have 3 different loops (1 sticky post, 3 evidence) and the load more starts from post #5.

In the main loops, I have excluded the already-showed posts with the IDs and “post__not_in” and everything works fine.

The problem is when I call the load more, the loop starts from post 1. If I set to start from page 2 I have a duplicate post (that’s because I have to load post in multiple of 3).

I’have tried to get the IDs list in my loadmore file with GLOBALS, but it seems not working 🙁

How can I pass my main loop variable to the load more query?

This is my main loop:

<?php
$myquery = new WP_Query([
    'post_type'      => 'post',
  'posts_per_page' => 3,
  'post_status'    => 'publish',
'orderby' => 'date',
'order'   => 'DESC',
    'post__not_in' => $ids
]); if($myquery->have_posts()): ?>

<div class="articles-container append-posts">
    <?php
    while($myquery->have_posts()) : $myquery->the_post();
$ids[] = get_the_ID(); ?>

<?php get_template_part( 'template-parts/loop', 'posts' ); ?>

<?php endwhile; ?>
</div>

This is the load-more file:

function misha_loadmore_ajax_handler(){

// prepare our arguments for the query
$args = json_decode( stripslashes( $_POST['query'] ), true );
$args['paged'] = $_POST['page'] + 1; // we need next page to be loaded
$args['post_status'] = 'publish';
$args['post_type'] = 'post';
$args['post_per_page'] = 3;
$args['orderby'] = 'date';
$args['order'] = 'DESC';

// it is always better to use WP_Query but not here
query_posts( $args );

if( have_posts() ) :

    // run the loop
    while( have_posts() ): the_post();

        // look into your theme code how the posts are inserted, but you can use your own HTML of course
        // do you remember? - my example is adapted for Twenty Seventeen theme
        get_template_part( 'template-parts/loop', 'posts' );
        // for the test purposes comment the line above and uncomment the below one
        // the_title();


    endwhile;

endif;
die; // here we exit the script and even no wp_reset_query() required! }