Additional SQL Server features and topics not covered by specific categories
The error may be a symptom of a mismatch between the dbo user within the database and the database owner recorded in sys.databases. Run the query below to see if the owner names are different:
USE YourDatabase;
SELECT
SUSER_SNAME(dp.sid) AS DboUserOwner
, SUSER_SNAME(d.owner_sid) LoginOwner
FROM sys.database_principals AS dp
JOIN sys.databases AS d ON d.name = DB_NAME()
WHERE dp.name = N'dbo';
To correct the problem, change the owner to a login which does not currently exist as a database user:
ALTER AUTHORIZATION ON DATABASE::YourDatabase TO SomeOtherLogin;
You should then be able to drop the XYZ user from the database.