Usernames from ldap, get random number when ldap object movesr

Hello, we want to offer saml login for the users, which were created and used to login via ldap (username and password) .
turns out, some have numbers behind their account login (samaccountname attribute from active directory) within the nextcloud database, upon investigating the database we found there are records of account logins corresponding, from other ldap DN’s (account was moved or perhaps deleted and recreated) , so our impression is nextcloud made some numbers up. however, those numbers like
accountmane_43432 do not fit with the new login mechanism saml.
can we somehow manupilate the users - remove the _43432 in a safe way: e.g. not causing hassle to the user ? the usernames are on many places within the database, thats why i ask here.

functions like
/var/www/nextcloud# sudo -u www-data php occ user:setting username_5976 settings user_id “username”

do not work, my impression is those are for local users.

thanks for any help