A script driven fragment has to return an XML document, and a linked document is not in XML format.
Not sure why you are using a script, since the element section, once expanded has a linked document section, which when selected will insert the contents of the linked document.
Remove the template fragments.
Expand the element section (the checkboxes)
Select Linked Document (If I remember correctly there are no fields to insert, just the linked document section
Save the template and regenerate.
Phil