Is custom menu name and category name linked in wordpress?

Nav Menus are actually taxonomies — eg. they are registered with register_taxonomy and get used to associated menu items (which are, of course, a custom post type!).

Slugs, which is what you’re trying to use here, have to be unique for a taxonomy term, this is enforced on the database level (not 100% sure on this). So there’s probably some logic inside wp_insert_term that changes the slugs to be unique.