Of course the result is the same. The conversion does nothing, you don't even get rid of marshaling, because you still calling a method expecting System.String, therefore the interop layer must marshal your X++ string to the CLR type.
Have you generated CIL? Have you debugged the code? Also, please give us all details from the exception.