The direction of the message should be changed or set.
SetTargetFrameVariable('eBiss.DocumentVars.MessageDirection', 'Outbound' )
With SetTargetFrameVariable() you can set the MessageDirection. If this is set differently from the previously determined value, the sender and receipient are also automatically swapped, so that the resulting message can be sent back directly, including the correct settings for the sender / receipient IDs at UNB.