This looked like a Windows error to me so I did a quick Google search and came up with the following link. It's a Dell site but it is in response to the same error code after trying to add a task in Windows Task Scheduler, so I think it might be relevant. Give it a try and see?
https://support.software.dell.com/reporter/kb/55146
Title
Adding the task in Task Scheduler returned an error. "Error Code: 0x80070520. A specified logon s
Description
The "Schedule Configuraion Check" might show error: "Cannot access windows scheduler task".
Adding the task in Task Scheduler returned an error.Error Code: 0x80070520.A specified logon session does not exist. It may already have been terminated.
Or, "An error occurred while scheduling the favorite. The scheduled task could not be created. Error code: -2147023584"
Resolution
Open Local Security Policy, by going to Start | Settings | Control Panel | Administrative Tools | Local Security Policy.
Navigate to Local Policy's | Security Options | Network Access: Do not allow storage of credentials or .NET Passports for network authentication
You must disable this option.