The flwm menu files in .wmx/Applications are not necessarily the same as the extension name, it can be any name that the extension maker wants in the menu. It is derived from entries in /usr/local/tce.menu/extensionname, it is not just the simple scripted removal of a file based on extension name as that file can have any name. It will take scripting to check for a couple of variables in the /usr/local/tce.menu/extensionname, Menu first then Program.
I tested cups with --force and the files were deleted, the directories remained. The directories remain as you do not want to remove /usr, /etc, and the like, which is what will happen if the extension maker includes base directories in the user.tar.gz. I will test this more.
"sed: /usr/local/tce.menu/menu: no such file or directory" means you don't have a /usr/local/tce.menu/menu file, that file is supposed to be there, at least last I checked. If not, a test for the file can occur.
"rm: can not remove '/user.tar.gz': no such file or directory" happens because the user.tar.gz is not symlinked into the filesystem. That is cosmetic and can be fixed.