Answer
Wrap the substitution value in TO_DATE(...) with an explicit format mask matching how the value is actually substituted (for example, TO_DATE('&OLD:WANTED_DELIVERY_DATE', 'YYYY-MM-DD')) rather than assigning the raw substituted string directly to a DATE variable — the substituted value's string format doesn't necessarily match your session's default NLS date format, which is exactly what produces this literal-format mismatch error when run through the application's own event-firing context versus a manual backend test.