Did you claim the task before calling the release method?? I think that you should claim the task first and then you can release it. If you have a fixed assignee to the task you cannot claim it because it's already asigned, so it should be asigned as a Group Task to be able to do the claim/release calls.
Greetings.