One of my longstanding techniques with spreadsheets is Copy / Paste Special Values (C/PSV), in place. Having used formulas to produce the values I\'m interested in, I C/PSV
Confronted to a similar issue (e.g. copying the result of a calculation from one range of cells into another range in which I needed the result alone without the formulas), using {contentsOnly:true} instead of SpreadsheetApp.CopyPasteType.PASTE_VALUES did the job.