The Scheduled Task includes one or more mailboxes that are unmanaged.
Ensure that only the managed mailboxes are considered for the scheduled task. You can manage mailbox license from Admin → License Management option.