Why e.namedValues is undefined in a form-bound trigger
Google Apps Script offers two different trigger contexts for form submissions, and they expose different event objects. A sheet-bound trigger (installed from the spreadsheet's script editor) gives you e.values, an array of strings, and e.namedValues, an object keyed by question title. A form-bound trigger (installed from the form's script editor) gives you e.response, which is a FormResponse object. The two do not overlap.
If you copy a routing snippet written for one context and run it in the other, e.namedValues is simply undefined. There is no error about a missing property until you try to read a key off it, at which point you get 'Cannot read properties of undefined'. The fix is not defensive coding — it is using the right event object for the context you are actually in.
For routing by answer, the form-bound trigger is the right choice. It fires before the response even lands in the summary sheet, and e.response gives you programmatic access to every item with full metadata: question title, item type, and the raw response value all accessible without relying on column order.