It amazes me that this part does not work. I’ve been trying for some time, too. HL7 is just a specialized HRL and VRL structure. So, if the specific works why can the general case work?
I’ve had a co-worker suggest that all I write a script puts a MSH segment in the front and then create a Z segment for each segment in the layout. Then set up a HL7 variant that describes this message. Seems like a lot of trouble, too, but it should work.