Thanks for your answer!
If I use the other constructor, it works in all cases.
var ts = new TaskService("RemoteServerName", "User", "Domain", "Password");
But since the user is already logged in on Windows 7, it is not very user friendly to ask for a password again each time the scheduled tasks are manipulated. It should be possible to use impersonation, right?
I have located the error as comming from the call:
v2TaskService.Connect(targetServer, userName, userDomain, userPassword);
on line 523 in the source code.
I tried to mess a bit with the source code and put the impersonation before the call to Connect, but it didn't work.