This will help to get the category post on tag archive page. Let me know.
<?php
$current_tag = single_tag_title( $prefix = '', $display = false );
$categories = get_categories( array('hide_empty' => TRUE) );
foreach($categories as $category) { ?>
<?php
$args=array(
'posts_per_page' => -1,
'tag' => $current_tag,
'cat' => $category->term_id,
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
?>
<div class="CategoryPost">
<h2><?php echo "Tag: " . $current_tag; ?></h2>
<h2><?php echo "Category: " . $category->name; ?></h2>
<ul>
<?php
echo '<ul>';
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<li>Post title: ' . get_the_title() . '</li>';
}
echo '</ul></ul></div><br>';
}
?>
<?php }
wp_reset_postdata();