This only happens in production and not in dev. I tried to track down the generated code that has the error, and it's in the screenshot. I also added a screenshot of the source code corresponding to where the error happens.
cc @jaunty apex who encountered this bug.