The code editor for calculated fields, which was introduced in SR19, does not provide helpful error message, if the entered code has a grammar syntax. It some case it just shows an "internal error".
It would be good to have hints how to improve the entered code.