According to the documentation, this endpoint is used to copy a user's mail from one folder to another folder, where the target mailbox needs to be a mailbox belonging to that user.
However, a shared mailbox is a separate mailbox that does not belong to a single user, so you cannot use the API to copy messages to a shared mailbox.
The EWS Move and Copy operations do support moving items between mailboxes.
Please refer to the link below for more information:
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.