How to remove a service from launchd added by mistake?
Immediately after removing the service you won't be able to find the service name in a distinctive and editable file. It's probably hidden in some cache.

After a reboot you should be able to remove its traces by performing these steps though:


Search for the name of the non-existent service to remove in the files of this directory: /var/db/com.apple.xpc.launchd

sudo grep -rnw '/var/db/com.apple.xpc.launchd/' -e "homebew"

Edit the file found by grep with nano (the string is probably found in disabled.plist)

sudo nano /var/db/com.apple.xpc.launchd/disabled.plist


Move the cursor to the two incriminating lines (service name e.g. &lt;key&gt;homebew.mxcl.cntlm&lt;/key&gt; followed by its status e.g. &lt;false/&gt;) and remove each with ctrlK. Hit ctrlO, ⏎ and ctrlX, ⏎ to save the changes to disk and leave nano.
Reboot again and launchctl print-disabled system won't show the service anymore.




Due to an agressive caching mechanism or other opaque system procedures, removing the lines doesn't work reliably with vim or nano (on the OP's system it didn't work at all, in my Catalina VM 5 out of 6 attempts have been successful).

Then the file has to be cleaned in Recovery Mode:


Boot to Recovery Mode
In the menubar open Terminal
Edit the file with nano. The paths depend on your main volume name (e.g. Macintosh HD):

/Volumes/Macintosh\ HD/usr/bin/nano /Volumes/Macintosh\ HD//var/db/com.apple.xpc.launchd/disabled.plist

Enter reboot to boot normally.