I type the following T-SQL code into a sql query window:
-- Get the SUSER_SID standalone
SELECT SUSER_SID('sql_someuser') AS SUSER_SID_OF_SQL_SOMEUSER
-- Get the SUSER_SID as part of a more complex query (should be the same, right?)
SELECT UserSid, UserId FROM User..UserSidToUserId
UNION ALL
SELECT SUSER_SID('sql_someuser'),12345
Here is the result set I get:

The first two rows of the second result set come straight out of the UserSidToUserId table. But that last row, the one with the UserId of 12345 that is added by the second query of the UNION ALL, the one whose UserSid is generated by the second call to SUSER_SID with the exact same user name is different!
Update:
Just so that there is no confusion, here is the definition of the UserSidToUserId table:
CREATE TABLE dbo.UserSidToUserId
(
UserSid uniqueidentifier NOT NULL,
UserId int NOT NULL,
)
How can two calls with the same user name to SUSER_SID produce results that depend on the context in which SUSER_SID is used, given that it is an absolute call that is context independent?
Your
UNIONis converting the second to a string, presumably however you’ve definedUser..UserSidToUserId.UserSid. Notice different answers: