Dynamic SQL Server cross tab
You are little modify the article example and modification contain error

@VAR1=(SELECT DISTINCT UserId FROM [IRIS].[dbo].[NDRoaster])


will return more than 1 result, and use it as:

@VAR3=(SELECT Mysingle FROM [IRIS].[dbo].[I_User] WHERE Id =@VAR1)


in You case - WHERE Id =@VAR1
not correct

original article use MIN and MAX

@VAR1=(SELECT MAX(UserId) FROM [IRIS].[dbo].[NDRoaster])


You can use any other filter for warrant single result from subquery

Also - wrong loop,
in this case (for each UserID) define cursor as 

(SELECT DISTINCT UserId FROM [IRIS].[dbo].[NDRoaster])


and fetch records in loop


define cursor
tutorial