Hacked, possibly - has anyone seen this message before?
From the picture it looks like someone placed your device in lost mode. When a device is placed in lost mode you have the option to display a message and a phone number on the lock screen. 

When you erased the device and signed back in with your Apple ID this would turn off lost mode for the device.