Thanks for your bug report. The main issue with such a change is that, as it has always behaved this way, all existing scripts that assume it is okay to /sockmark without checking for existence of the socket would break.
There are quite a few scripting features that do not display errors in similar situations. At the time of implementation, this was either requested or it seemed like a good idea. In retrospect, I would have preferred to have made the scripting language consistently strict in all contexts. Unfortunately, it is hard to apply this now without breaking scripts.