Unwanted Duplicate Posts Showing in Pagination Pages

Try with a custom WP_Query to rule out any possible code messing up with your main query pagination. Like this:

<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$query = new WP_Query( array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 5, 'paged'=> $paged) );

?>
<?php while($query->have_posts()) : $query->the_post(); ?>   

<div class="blogcontent"> 
    <div class="post_img"><a href="https://wordpress.stackexchange.com/questions/364381/<?php the_permalink(); ?>">
    <?php $img = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
    <?php $image_alt = get_post_meta( get_post_thumbnail_id($post->ID), '_wp_attachment_image_alt', true); ?>
                <?php if($img) { ?>
                    <img src="<?php echo $img; ?>" alt="<?php echo $image_alt; ?>">
                <?php } ?></a></div>
    <div class="post_content">
    <?php 
        $category_detail=get_the_category($post->ID);//
            foreach($category_detail as $cd){ ?>

                <a href="<?php echo get_home_url(); ?>/category/<?php echo $cd->slug; ?>/"><span class="boldtag"><?php echo $cd->cat_name; ?></span></a>
        <?php       }
    ?>

        <h1><a href="https://wordpress.stackexchange.com/questions/364381/<?php the_permalink(); ?>"><?php the_title();?></a></h1>
        <?php the_excerpt(); ?>
        <ul class="author clearfix">
            <li>By <em><?php the_author_posts_link(); ?></em> <span>ยท <?php the_time('M d, Y') ?></span></li>
            <li><a href="https://wordpress.stackexchange.com/questions/364381/<?php the_permalink(); ?>">MORE...</a></li>
        </ul>
    </div>
</div>
<?php endwhile; ?>
<div class="paginationsec">
  <nav class="navigation pagination show">
    <div class="nav-links">
    <?php 
        echo paginate_links( array(
            'base'         => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
            'total'        => $query->max_num_pages,
            'current'      => $paged,
            'format'       => '?page=%#%',
            'show_all'     => false,
            'type'         => 'plain',
            'end_size'     => 5,
            'mid_size'     => 1,
            'prev_next'    => true,
            'prev_text'    =>__( '<i class="fa fa-angle-double-left"></i> Prev', 'twentyfifteen' ),
            'next_text'    => __( 'Next <i class="fa fa-angle-double-right"></i>', 'twentyfifteen' ),
            'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( '', 'twentyfifteen' ) . ' </span>',
            'add_args'     => false,
            'add_fragment' => '',
        ) );
    ?>
    </div>
  </nav>

</div>