"TypeError: Cannot read property 'submit' of null" is cheap (just render whatever error you get).
Anything else is expensive, and probably doesn't gain you anything.
I don't know that there's a lot of useful middle ground between your two examples though. By definition, a UI can't really give actionable advice on how to fix an error that it isn't programmed to expect.
It was a bit of a rhetorical statement (or at least in my mind it was). Like how about "Something went wrong (see details)" or something to that effect?
In my work experience some people are really dogmatic about the idea of not showing any sort of error messages to users whatsoever.
So I'm very sympathetic to people arguing against showing error messages.
The user probably can't do anything about a null reference, so there's not a lot of benefit in providing this level of detail, and for most users it obscures the bigger point that "something went wrong."
I sometimes hear the "best of both worlds" is something like logging all errors while showing optimistic errors to the users on frontend. This is somewhat fine for errors that happen on the backend, but catching browser errors is tricky because extensions can throw errors. On top of that a user might not be comfortable with you collecting errors that happen in their browser.