Symptoms
Users randomly get this error "SmartObject property FileLeafRef is a required property for selected method AddAttachment. Filename property must be set." when submitting requests using smartforms.
Diagnoses
It looks like the attachments are not being added correctly all the time, possibly due to performance issues. That is why it is intermittent like this.
Resolution
Moving the behavior to a direct SmartObject call resolved the issue.
Instead of using the Execute the Add Attachment method for the view, we changed it to On the SPListAttachment Smartobject, execute the Add Attachment and configured it correctly. This resolved the issue.