When an Exchange Online user has access to a shared mailbox through full access permissions, he can reply on behalf of that address. The problem is that, by default, emails sent as the shared mailbox are saved in the user’s main mailbox instead of the delegated mailbox. To fix that you have 2 options:

Option 1: Use Exchange Online Powershell

For emails sent as the shared mailbox (Full Access)

Set-Mailbox <shared mailbox> -MessageCopyForSentAsEnabled $true

For emails sent on behalf of the mailbox (Send On Behalf)

Set-Mailbox <shared mailbox> -MessageCopyForSendOnBehalfEnabled $true

Option 2: Registry

HKEY_CURRENT_USER\Software\Microsoft\Office\x.0\Outlook\Preferences

DWORD DelegateSentItemsStyle 1

Note! Outlook must be configured to run in cached mode, otherwise mails will get stuck in the Outbox.

References:

https://learn.microsoft.com/en-us/exchange/troubleshoot/user-and-shared-mailboxes/sent-mail-is-not-saved