Actually I don't need Exchange Onprem mailbox because I want to use Exchange Online.
If so, you could disable Exchange on-premises mailbox directly (Disable mailbox from Exchange on-premises admin center). It will disconnect Exchange on-premises mailbox from AD account.
Then run "Start-ADSyncSyncCycle -PolicyType Delta" to force update AAD Connect. After that you will coudl assign license to this account from Microsoft 365 admin center.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.