How can I make a WordPress sub-menu with a top-level that isn’t clickable?

you should create a Custom Links from Menus > Add menu items > Custom Links instead of a WordPress page. your new custom link can be a parent of a sub-menu. Just drag it to the position required.

enter image description here

error code: 523