As you have discovered… you can only assign a shortcut to a menu item it it is actually there…
‘Edit-group’ only appears if a group is selected - so preselect a group before trying to assign a shortcut to it…
Other common shortcuts that are context-sensitive relate to faces - like orient and reverse, which need a face [or faces] to be selected before they appear in any menu.
If you are looking to add any context-sensitive shortcuts make sure you preselect the relevant entity first…
Also remember that the shortcut ‘filter’ is you friend …