I think that this call in Moralis.js:
user.set('accounts', uniq(.concat(accountsLower, user.get('accounts') ?? )));
could be replaced by:
> user.addAllUnique('accounts', accountsLower);
If I understand it correctly you only want to merge those 2 arrays making sure no duplicated are in the final array, so I think that method would do it.