It probably has to do with how you set up the task. Are you running it from the C:\ drive? Is the local folder where you have it a trusted location? When the task runs at night are you still logged on the machine with the same user privileges as when you run it manually (you need to be able to access the network folder where the back-end is located, copy the back-end file ti the local folder on C:\ run the VBA code inside the compacter and copy the file back)? When you setup the task you have the option to chose "Run if user logged on or not". Also check the other settings (wake computer if idle, network availability).

Let me know how it goes please!
Cheers,