Since only one is synced with M365, then the other one should not even be able to login unless the UPN is the same (which seems to be similar.)
What's the config you put in Settings > M365 > Sign-on?

Founded in 2005, when VoIP was an emerging technology, 3CX has gone on to establish itself as a global leader in business communications.