By default, if you send a mail on behalf of a Shared Mailbox, the sent item will be saved in the user’s primary mailbox and not the shared mailbox. If you want to change it to expected behaviour, i.e. save the items in the Shared Mailbox, execute following command. This works in Exchange Online and Exchange OnPrem.
set-mailbox -MessageCopyForSentAsEnabled $True
set-mailbox -MessageCopyForSendOnBehalfEnabled $True