These templates can contain version settings, workflows, content types, etc.
When a library is created based on the template the only thing that needs to be done is setting the default metadata fields in that library.
At a project where we were building a project portal we received correlation ID errors on the option to set the default metadata fields on a library.
The problem was that as this was an Office 365 environment troubleshooting was more difficult.
We soon discovered that every library created by this template received the errors where if we created a library by hand and configured everything we didn't receive the errors.
Also creating a library from another template wasn't a problem.
Then we found the solution:
The customer requested to modify one of the content types after the template was created.
This resulted in the error when a library was created based on the template.
Re-creating the template with the correct content types and creating a library from this template solved the error.