Wrap wp_nav_menu output around option tags for select menu

Have you checked wp_dropdown_categories function?

It displays or retrieves the HTML dropdown list of categories.
I’m unsure of your exact needs but it could be a good starting point.

error code: 523