I was able to find the root cause of the issue. This issue comes when wrong values passed to two parameters 'Assignto' and 'Worklist' whenever we route an assignment.
For ex if we set operator name to 'Assignto' and set 'Worklist' as false it will try to call workbasket activity for which class is Assign-Workbasket. Therefore we get wrong class exception. Same thing happens if workbasket is set to 'Assignto' and set 'Worklist' to true.