It may be the user context the task is running under.
I believe when you manually run it, it will execute under the user who ran it.
When the scheduler runs it, I think it is the last user who authenticated.
You can change the context inside the scheduled task configuration.