Open the task with PFTC. Click the "Binding Object Method" button (button with two green boxes in the bottom & left side of the screen). Does the binding from method to task look correct (or does it even exist)? Are you really returning the value from the method to the task?
If the above binding stuff is correct, then at least try to make the whole thing again (leave the existing container element & code there). Create new container element to the task, add necessary coding, check the bindings, generate the object again in SWO1, etc. At this point you don't need to bind the element from task to workflow - you first priority should be to get the task container element populated with the value (check from SWIA). If you get the task container element populated, then for sure the binding from task to WF container will work. Sometimes it is worth to do things again - when doing it, you might see something that you've didn't notice before...
And as Rick said, do your tests with completely new workflow instances. Make sure that the test workflows are running with the latest version that include all the new stuff (including the bindings etc.).
Kind regards,
Karri