The thing is that Adaxes can retrieve a password for a user when it is set via Adaxes, that is, during the operations of creating a new user or changing a user's password. When a password is already saved in AD, it is impossible to retrieve it in Adaxes.
In your Business Rule for students, you create an Office 365 account within a Business Rule triggered upon creating a new user. In such a situation, a password can be retrieved and passed over to the Office 365 account. However, in the situation with teachers, you use a Custom Command to create an Office 365 account. Executing a Custom Command is a completely different operation than creating a new user, and thus it is impossible to retrieve the password and pass it to the Office 365 account.
Since Office 365 does not allow creating accounts without passwords, it generates a temporary password on its own, which, as you can see, is completely different from the password generated by Adaxes:
To remedy the issue, you need to move the logic for enabling the Office 365 account from the Custom Command to the Business Rule triggered after creating a user.
by the way: is it possible to generate passwords without similar letters?
It is possible to do this using a script and a Business Rule triggered after creating a user, but in this case you'll need to perform all password-related operations within the same script (such as sending an SMS message to the new user, creating the Office 365 account etc).