Pagination don’t list all entries on Index.php

Thank you both.
Meanwhile I got it to work perfect. The way was done with pre_get_posts.

My solution now is the function:

function numberposts_for_index( $query ) {
if( $query->is_main_query() && ! is_admin() && $query->is_home() ) {
$query->set( 'posts_per_page', '4' );
$query->set('post_status','future,publish');
}}
add_action( 'pre_get_posts', 'numberposts_for_index' );```


and my code in the index.php now:

```<?php 
if(have_posts()) :
    while(have_posts())  : the_post();?>
<?php the_content('<br />→ weiterlesen …'); ?>
<?php endwhile; ?>
<div><?php the_posts_pagination( array(
    'mid_size' => 4,
    'prev_text' => __( '←', 'neuere Beiträge' ),
    'next_text' => __( '→', 'ältere Beiträge' ),
) ); ?></div><p>&nbsp;</p>
        <?php else :?>
<h3><?php _e('404 Error: Not Found', ''); ?></h3>
<?php endif; ?>
<?php wp_reset_postdata();?>```

error code: 523