Hi @zuleika_v .
I've just come across the same issue and have fortunately found a solution.
The Manager Hierarchy Model in Dataverse is based on the "Users" table, which is different from the the Entra ID (AAD) table.
In my problem, I had an MDA that allowed users to associate a Line Manager to another user. The Line Manager field was a lookup to the Entra ID table and the user record was associated with the users Entra ID account as well. . When a Line Manager was added or changed, as you mentioned above, it needs to update the Manager in the Manager Hierarchy Model. In my scenario, I'm dealing with 900+ users, so managing them manually would be a nightmare.
My solution was to build a flow that monitored my custom user table and when a line manager was added or changed, To my benefit, I was starting with both the user and their managers IDs in the MDA anyways. I would query the Users table for both the user and the line manager. Once I got the ID's for each record from the User table, I could then update the record in the user table as needed.
Just a heads up, the Manager field in the Users table (the table that feeds the Manager Hierarchy Model) is a lookup field. So you need to use the following syntax to pass the retrieved managers record ID into that column when updating, /systemusers(ManagerRecordID). Its just defining the table logical name required for updating lookups.
The flow worked for me and is now keeping my MDA table of line managers synced with the Hierarchy Model.
I also created a quick manual flow that queried all users in Office365, retrieved their managers, and then queried their individual User ID stored in the User table. With an apply to each, I updated all the Managers in the User table in one go directly sources from AAD.
Hope this helped.