Why setName silently kills your script
Apps Script's setName throws a generic "Service Spreadsheets failed while accessing document" error when the name you pass already belongs to another tab. Google Sheets does not allow two tabs to share a name, and the API enforces that constraint at call time, not at validation time. The script dies, the quota-copied sheet sits in your spreadsheet as "Copy of [source]" at the far right, and nothing cleans it up.
The first time I hit this it was in a weekly reporting script that duplicated a template tab and named it after the current week. It worked fine for months, then someone manually created a tab with the same name and the next Monday run left three orphan copies before anyone noticed. The fix is one getSheetByName null-check before you ever call setName.