Yes I tried the approache mentioned by you.
Yes I did debug the code.
I was able to print the ID's of selected items when the button was pressed.
I also trigerred the WF from the same code for the ID's selected.
But when I add the second action of type ReturnFromAction I get this error.
It would be great if you can share your web part and code snippet along with the list template.