Diagnostic Codes Disabled In Dialer?
It's possible that your phone does not support the code. If you look at one of the comments in the askvg link you shared in the comment, one user says: LCD TEST Does not work for Galaxy S2. However, another user replied that it is supported, but with a different code.