Just the fact that they have the same name doesn’t mean that WP knows the menu “main-menu” goes in the location “main-menu”. You will have to specify this, as you can see from the source code of wp_nav_menu
:
$args = array (
'menu' => 'main-menu',
'theme_location' => 'main-menu',
);
wp_nav_menu ($args);