How to remove container for menu in Navigation Menu

I have a footer widget that has a Navigation Menu block. I want the wrapper div for the ul to be a nav tag. How can i do this? I tried it with the ‘wp_nav_menu_args’ hook, but it doesn’t work. Although for a header menu made with wp_nav_menu it works.

register_sidebar(array(
  'name' => 'Footer Widget Area',
  'id' => 'footer-widget',
  'description' => 'Footer Widget for blocks',
  'before_widget' => '<div class="footer-content__widget">',
  'after_widget' => '</div>',
));


function my_nav_menu_args($args = '') {

  if ('footer' == $args['theme_location']) {
    if ($args['container'] == 'div') {
      $args['container'] = 'nav';
    }
  }

  return $args;
}

add_filter('wp_nav_menu_args', 'my_nav_menu_args');