I’m not sure about the specifics of the user you’re trying to delete, but the error you’re seeing likely stems from one or more of the following checks not being met.
Most likely, it’s something in the else block. And yes, I agree, the error message could definitely be less vague .