Discord (and I believe Blizzard/Battle.net) does this. Your site-wide username would be something like Example#5436 but on individual servers you can be tagged with @example
Re:Let’s talk about usernames
by andrewaylett on Monday February 12, 2018 @05:47AM
(#16357844)
When Google introduced account names in G+ (separate from gmail account names), they started by doing this. But I suspect it was a fairly big turn-off for people who are used to getting their usernames.
This gives every 'username' an effectively unlimited space of identifiers via the number suffix, and it trains users to realize that 'person who controls the account with username X' is not necessarily the same person as 'person who I know on other sites as username X'.