Error when trying to move mails through RPA.Outlook.Application

Whenever I try to move an email from one folder to another I always get this error:

com_error: (-2147352567, ‘Eccezione.’, (4096, ‘Microsoft Outlook’, ‘The operation cannot be performed because the object has been deleted.’, None, 0, -2147221238), None)

So the bot actually finds both the mail to move and the target folder but it doesn’t move it. The weird thing is that it actually deletes said mail from my Outlook account.

Has anyone ever had this problem?

Could you also share the code part you are using to move the mails?

Here it is, pretty much the same as the documentation, I’ve sent myself an email that has “Test rpa” as subject and from the log file it actually finds it. But right after finding it and finding the target folder it gives me this error.

${secret}=    Get Secret    credentials
Move Emails
    ...    account_name=${secret}[username]
    ...    source_folder=Folder1
    ...    target_folder=Folder2
    ...    email_filter=[Subject]="Test rpa"