The AutoTextReference SDK call fails with "Undefined error 000" when it encounters identical text content in a library text statement that is of a different ELEMENT_TYPE than the requesting local text statement.
AutoTextReference SDK call fails with "Undefined Error 000" code with no hint about the root cause. There is no way to work around that in Automation Engine. No single text statement of the Content Sheet in question gets replaced by library smart text statement content.
The expectation is that it instead creates another text statement in the library of the requesting document's ELEMENT_TYPE, so that in the end there is the same text existing in multiple text statement of different ELEMENT_TYPEs. The input data from the customer is organized in a way that it contains this type of duplicate content. This cannot be changed.