The harm to an SSD comes from writing to the disk because the data cells are good for only a finite number of write operations.
Moving files to the trash does not physically move or rewrite the file it simply changes the pointers in the disk directory, a single write operation to only a few data cells, and has minimal effect on drive life. Deleting the file from the trash is a similar write operation to the volume directory to "forget the file and flag the data cells as reusable which again has only the absolute minimum effect on SSD life.
A SECURE erase writes to the storage location several times and therefore reduces the life of those data cells. It is also arguably unnecessary on an SSD (particularly if the entire disk is encrypted).
Your explanation re
writing is what broke the code. All this time, I had been obcessed with moving, trashing, deleting, and erasing. I completely overlooked the writing piece of the issue.
Many thanks kind sir. A bit more light is now in my life.