Getting Msg 15151, Cannot alter the user 'xxxx', because it does not exist or you do not have permission
You are missing create user before you alter it.

Login - gets you entry to the server
Database User - gets you entry to a particular database 

so in your script, add create user from login ...

USE [xxxx-xxxx]
create user [xxxx] from login [xxxx] &lt;--- this is needed !
ALTER USER [xxxx] WITH DEFAULT_SCHEMA=[db_datareader]
ALTER ROLE [db_datareader] ADD MEMBER [xxxx]
ALTER ROLE [db_datawriter] ADD MEMBER [xxxx]
ALTER ROLE [db_owner] ADD MEMBER [xxxx]
GO


few things : 


sys.syslogins is deprecated.
dbatools has cmdlets for Login and user management which you can leverage for automation.