Hello Chenyang Rickard,
How is your issue going? To add to my previous answer, the User Account Control elevation prompt is rejecting your Microsoft 365 business password because your cloud identity does not currently possess local administrative privileges on this specific Windows installation. If you are operating a personal computer, the consent.exe process is attempting to authenticate against the local Security Account Manager database rather than your cloud tenant. You must bypass the cloud prompt by entering the credentials of the local administrator account created during the initial Windows Out-of-Box Experience, formatting the username as .\LocalAdminName to force local authentication. Conversely, if this is a corporate-joined device, your User Principal Name simply lacks the required directory role assignment. Following Microsoft Entra deployment best practices, your global administrator must explicitly grant these rights by assigning your identity the Microsoft Entra Joined Device Local Administrator role via the Entra admin center under the device settings blade. For environments managed by Microsoft Intune, the administrator should deploy an Endpoint Security policy utilizing the Local User Group Membership profile to securely inject your Entra ID Object ID into the local Administrators group, which maps to SID S-1-5-32-544. Until this directory role is assigned and the device completes a primary refresh token sync, Windows will continue to reject your M365 credentials for software installations.
Hope this answer brought you some useful information. If it has, please consider accepting the answer so that other people sharing the same issue would benefit too. Thank you :)
VP