Looks like the error message was changed in Grafana 10.2.3 (not sure whether it is mentioned in the change log), now it just shows “An error has occured. Check console output for more details”, without extra details:
Anyway the question is still open, how is it possible to customize such popup messages?