How to add a nolink menu item
Try adding the following, but this will still reload the page, which may not be ideal. 

url: 'internal:#nolink'


These module maybe interesting as it may not be necessary to manually edit the menu code. You can add a class to a menu item and add CSS

pointer-events:none; cursor:default; text-decoration:none;


https://www.drupal.org/project/link_attributes
https://www.drupal.org/project/menu_link_attributes