Menus not visible in Appearance after being registered

There’s nothing wrong with your theme_setup() function in your functions.php file.

The error you get simply points out the fact that the menu name Main Menu already exists.

In other to resolve this you should replace your Main Menu menu name definitions in your functions.php file with something other than what it currently is.

It’s possible you might be using a theme or a plugin which already has a menu name registered as such, accounting for the current menu name conflict.


Update:

Your code works well. I think your challenge has to do with registered menu location vs actual menu (form the dashboard, as actual menus to be rendered into a given registered menu location).

What you should do: type inside the “Menu Name” input box as seen on you first shared screenshot a new menu name, then, click on the “Create Menu” button; your custom registered menu locations will then be visible as seen in the screenshot below:

Newly created menu (stacktest)