I’m not familiar with the EDI stuff, but this sounds like an error that can happen with documentToRecord when the recordName parameter is not used. This means that documentToRecord will not know that the expected output type is a StringList even if there is just one element in the incoming document.
In EDI the template is used for a similar purpose. Check the field in question’s definition in the template. If the field is not defined it may be defaulting to ‘best-guess’ behaviour based on the incoming document.
HTH,
Fred