TemplateData from transcluded items (i.e. doc pages) takes a long time to show up in the API.
A temporary solution to this is to do a null edit (opening the page, and saving, without making any changes) which will cause the template data to propagate immediately.