Menu location switcher – example code fails

So, the code in the documentation assumes that the menu you’re trying to get is set as the primary menu. If the menu you’re trying to get isn’t the one set as primaryin Apperance -> Menus, this error will show. I suggest you try to work with their name or slug instead.