WP Archive & Category Pages not filtering

From the codex for get_posts()

The category parameter needs to be the ID of the category, and not the category name.

So you should either use category_name parameter with name or you could pass the ID to category.

<?php
  $term_name = get_queried_object()->name;
  $args = array ( 'category_name' => $term_name, 'posts_per_page' => 5);
  $myposts = get_posts( $args );
  foreach( $myposts as $post ) :    setup_postdata($post);
   ?>
  <li>
    <?php the_title(); ?>
  </li>
  <?php endforeach; ?>

or

<?php
  $term_id = get_queried_object()->term_id;
  $args = array ( 'category' => $term_id, 'posts_per_page' => 5);
  $myposts = get_posts( $args );
  foreach( $myposts as $post ) :    setup_postdata($post);
   ?>
  <li>
    <?php the_title(); ?>
  </li>
  <?php endforeach; ?>