I know of no PHP mechanism which would clear out your attachments folder, this is not a standard behavior
In the past I have experienced other files to that has been cleared out.
Files in includes folder has been emptied but it was some years back.
The attachment folder has been emptied 4 times, one last spring and then three days in a row a few days ago.
I kept restoring it with the backup function. Then we increased php max limit size from 128M to 2048M and it has worked since. Honestly I have no clue what caused it but now you programmers now it can happen.
Oh now while editing this post I remember when editing and submitting it takes me back but tha doesn’t happen anymore on my forum. But it’s another topic.
Thanks