Let’s check if your ID is not switching when you’re changing the password.
When you do the passwd command it should stay with no problem.
please run the following commands
info sudo teamviewer passwd [password] teamviewer
Please verify that TeamViewer info always show the same ID
Let’s us know the result so we can determine a solution for you.