Based on your description, you could export most of mailboxes successfully, it means there doesn't exist issue with permission for Exchange server and target folder.
I would suggest you take steps below to narrow down it:
Use command below to check the SamAccountName for failed mailbox, then try to export data for this mailbox specialized. Check whether could export successfully.
$t=(Get-Mailbox FailedMailbox).SamAccountName
New-MailboxExportRequest -Mailbox $t -FIlePath \\EXCH\temp\$($t).pst
If you cannot export data for this mailbox, it means there may exist issue this mailbox itself. Try to migrate this mailbox to another database, the migration action could repair some issue for mailbox.
If you could export data for this mailbox, it means there may exist limitation on session for export. I would suggest you try to split the source CSV into multiple part, then check whether could export all mailbox successfully.
You can also try with "UserPrincipalName" rather than "SamAccountName".
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.