Hi Adam,
I experimented removing "$UI_Menu_SetPassword" and I also get the same error message when entering a chat room or using messenger. It seems trying to remove any menu item this problem happens.
I haven't made any other changes to this file, so the problem must be elsewhere. Are you able to re-create the problem your end?
Many thanks
Mike