A legend request in ArcGIS REST API returns the error, "An unexpected error occurred processing the request." for services containing a terrain dataset.
This issue is not reproducible in the current release of the software. Contact ESRI Technical Support (for users in the United States) or ESRI distributor (for users outside the United States) to resolve this issue, if the issue persists.