@Andrii Maslov
Did you also try the Full Access permission? The Full Access permission lets a user open the shared mailbox and act as the owner of that mailbox.
You can set from EAC > Recipients > Shared > select your shared mailbox and click Mailbox delegation to grant Full Access permission.
You also can use the following command to grant full access permission:
Add-MailboxPermission -Identity "shared mailbox" -User username -AccessRights FullAccess -InheritanceType All
Get-MailboxPermission "shared mailbox"
Wait for a while to make sure it takes affect, then test to use OAuth authentication to connect with SMTP again.
Additionally, did you assign a license to the shared mailbox?
You can create a new shared mailbox without license to test again to see if the issue can be reproduced on the new one.
If the response is helpful, please click "Accept Answer" and upvote it.
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.