I had a similar problem. I have an iMac running Catalina 10.15.7 but I think my solution will work for any recent OSX version.
Basically, I had an unwanted user folder inside my Users folder but this user didn't appear in the System Preferences > Users & Groups menu and so, it appeared that I couldn't delete it from there.
If that's the problem you face then, go to the Users & Groups menu, authenticate yourself (click on the padlock and enter your credentials), then click on the '+' to add a new user. Give this user exactly the same name as the unwanted user you want to delete. The new user will be created in Users & Groups. Now click on the '-' to remove that user. You will see a dialogue box asking you to choose from 4 options. The one you want is 'Remove the user's home folder from the computer'. Click OK and you'll find the unwanted user folder inside your Users folder is no longer there.
You can find more instructions on this here : Delete a user or group on Mac - Apple Support
But, unfortunately, I only discovered the above solution AFTER I'd made the mistake of dragging the unwanted user folder to the trash. Once the unwanted user is in the trash, there appears to be nothing you can do to remove it by any of the normal means - if you try to empty the trash, you get a system message advising that 'Voice Trigger' is in use and another that says 'Library' is in use. I tried dragging it back to the Users folder and my desktop and it just created a copy and left the original in the trash; I tried the 'delete immediately' option; I changed the permissions on the folder to allow an Administrator to read & write (and hopefully delete - but that didn't work); I tried a number of Terminal commands; I tried installing an app called iTrash that forces deletion of 'stuck' items; I revealed the hidden files / folders in my own User folder (using cmd-shift-dot) and found the 'bin' folder with the unwanted user inside - I opened that and found the culprit 'voice trigger' folder. I tried setting the permissions on that to Admin read & write but even that didn't work; I tried booting into safe mode and seeing if I could delete from there but that didn't work either. Nothing seemed to work.
So, here's what I did. I have a bootable clone of my hard drive on an external drive as insurance (made with Carbon Copy Cloner). I plugged that drive in and set it as the startup disk (System preferences > Startup disk) and rebooted. Once the mac had booted off the external drive, you can see the internal MacintoshHD drive in the left panel of the finder window in the usual place. I opened the MacintoshHD and navigated to my own User folder and use cmd-shift-dot to display the hidden files and folders therein. I found the .Trash folder and inside it was the rogue unwanted user folder I had been trying to delete. Only this time, as I'd booted off of the external drive, the unwanted user folder wasn't in use by anything so I was able to drag it to the trash (ie the trash can in the dock) - and was able to empty the trash in the normal way.
I switched the start up drive back to the MacintoshHD and rebooted and voila - the rogue unwanted user folder had gone from the trash.
Hope this helps someone.