If this happens please check the versions first of all to determine in which version it was the variables stopped being replaced.
Once you have determined when this happened then view the audit trail of your document and review the activity that happened between the version in which the variables were replaced and the version in which this stopped happening.
It is highly likely that the document was downloaded at this point and then uploaded with the variables replaced, therefore removing the option of variable replacement from the Document.
When working with documents with variables all changes need to be done in live edit to preserve the variables or if a new document is uploaded it should contain the variables and not the replaced variables.