I managed to get this to happen with the simplest possible code:
function test() { var ss = SpreadsheetApp.getActiveSpreadsheet(); Logger.log("before&quo