you must have an active knowledge session to be able to complete task. If you loaded one from db please make sure you have work item handler for handling human task active as well (meaning connected to task server). If you disposed previous session it is good to dispose your work item handler for human tasks as it needs to be disconnected otherwise it will keep getting events from task server and could lead to the exception you have. Session is already disposed but handler was still active.
HTH