Okay, so as a workaround, what if you make copies of all those folders and files and place a duplicate copy somewhere safe (outside of your Terraria folder), but also keep the original folders and files in the original spot (in your Terraria folder).
After you save and exit, create another duplicate of those files. That way if they disappear out of your Terraria folder, you can send a copy of the files back into the Terraria folder. But always keep an up-to-date copy somewhere safe.
Do you have any file cleaning or storage saving apps or something in the settings that may be set to automatically cull files? Look to see (in Storage or Device Maintenance menu) if you have a “Smart Clean” feature enabled.
Or do you have any backup apps, such as Dropbox, that are set to automatically back up your files then remove them from the local device?