Hi Onanie,
Mendix does not know what kind of object is returned by the Javascript action because there is no mapping to an Mendix entity. Therefore you can only return variables like string or booleans but not objects.
What you can do is store the response in a JSON string and return that as variable from your Javascript action. Then in the nanoflow, as the next activity, use an import mapping to turn the JSON string into a Mendix object.
Another question: what kind of call are you doing to your server, is it a REST call? If so, why are you not using the ‘Call REST’ activity that Mendix offers?