I have code that combines several Google Docs into one file, and code to save a Doc as PDF:
function createPDF(docId) {
var docFile = DriveApp.getFileById(
I think that happening because you're not saving and closing the docs.
Check this out https://developers.google.com/apps-script/reference/document/document#saveandclose
And try closing your doc at the end of the mergeDocuments function.
tehhowch have explained this in comment also, some credit goes to him too. :)