Hi Gaurav,
this means that in the implementation of the function module in the JCoServer either a cast is done of two classes that are not really fitting to each other or that the instance that shall be assigned to a variable has been loaded by a different class loader and therefore it does not fit. Even the same classes are considered different, when being loaded by different class loaders. Hence, check the function implementation, the issue is neither located in the ABAP system nor in the RFC communication nor in JCo.
Best regards,
Markus