'Wordpress Pagination on Post page paginate (the_posts_pagination)

So basically I have some posts on a post page. The posts show and the pagination shows. However, when you click the next page it does not go to the next page.. it cleans the URL and just reloads the same page. Not sure if there is a different way to be doing this? Any advice here would be great!

Code:

<div class="list-grid-view">
                <?php get_template_part( 'template-parts/episode-filter' ); ?>
                <div class="filtered-posts">
                    <?php
                    $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
                    global $wp_query;
                    $original_query = $wp_query;
                    $args = array(
                        'post_type' => 'episode',
                        'posts_per_page' => 8,
                        'paged' => $paged,
                        'post_status' => 'publish',
                        'orderby' => 'date',
                        'order' => 'DESC'
                    );
                    $the_query = new WP_Query( $args );
                    $wp_query = $the_query;
                    if ( $the_query->have_posts()) :
                        while ( $the_query->have_posts() ) : $the_query->the_post(); 
                            get_template_part( 'template-parts/episode-content-post' );
                        endwhile;
                        the_posts_pagination(array(
                            'mid_size' => 2,
                            'prev_text' => __( '<', 'textdomain' ),
                            'next_text' => __( '>', 'textdomain' ),
                        ));
                    endif;
                    $wp_query = $original_query;
                    ?>
                </div>
            </div>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source