Why V8 rejects the old syntax
Rhino, the JavaScript engine Apps Script used before 2020, was built on Mozilla's SpiderMonkey lineage and inherited a non-standard extension: conditional catch clauses. The syntax looked like catch (e if e instanceof SyntaxError), and Rhino treated each clause as a separate handler that only matched when its condition was true.
V8 — the engine behind Chrome and Node.js — never implemented this extension. It expects a single identifier after catch (, nothing more. When it hits the if keyword in that position, parsing stops entirely and throws "Unexpected token if" before a single line of your function body runs. The error appears at the catch line, which can be confusing if you expect runtime errors to come from inside the try block.
If your project was created before 2020 and you recently enabled the V8 runtime (or Google migrated it for you), this is the most common immediate breakage. Scripts that ran for years under Rhino hit this on first execution under the new engine.