When I run the program in picture-in-picture mode, I cannot connect to Outlook server
Did you see this Picture In Picture ? It’s written :
Automations that depend on Microsoft Outlook do not run successfully in PiP if the application is already opened in the main session. To make sure that the automation can run smoothly, quit Microsoft Outlook in the main session before running the automation in PiP.
Can you try to disconnect from the main session?