I got the same problem and tried all solutions here, not working, but these solutions are very helpful which I base on them to build up a solution that work for me. I typed the detail instructions but accidentally close Safari, so I put my idea in short, the idea is change the affected username (which you want to remove) to look like a guest user as much as possible:
- Take ownership of the /users/affected_username (the username that you want to remove) using Finder or Terminal sudo command (see instructions in one of the responses). Use Finder to change the name of this folder to match with Home directory that you change in step below.
- In users and groups, right click and change the affected username -> Advanced Options -> to have all the fields change to another similar 'guest' user as much as possible (you can enable the guest user, get the idea, then change) including User ID, Group, Account Name, Full name, Home directory
- Change the Unique ID of the affected username using Directory Utility -> Directory Editor to another number (like 2020)
- Save everything, log off, restart, log on with your admin user name
- Go to Users and Groups again, and hope you see the minus sign "-" enabled again for you to delete the annoying username. Good luck!