QIE will send the error message it gets to the sender. Example "ERROR: error processing response script: com.qvera.qie.web.exception.MessageModelException: Expected first segment to be 'FHS', 'BHS' or 'MSH', but it was not.". This is not sent in a HL7 format and may or may not cause an error on the sender side.
We have opened a Ehancement 1764 to add the ability to modify the response sent on a error.
Workaround:
Create a text channel to receive the message that uses a mapping and destination to send the response.

Add a mapping that tries to parse the message as hl7 message in a try/catch. If errors then send a HL7 error response.

Set the destination to call the HL7 channel and return the response to the original sender.
