Probably EntityClass$() should be enhanced, allowing to check non-handles as well as handles that are no longer valid and then return an empty string
The problem is that the handle is simply a pointer, which enables a fast, direct access. To do what you suggest it would have to scan the list of alive entities in order to know it's not a valid entity handle (though it could be enhanced with an associative container, but still).