A.M. As Gar mentioned it looks like it may be a DC motor and unless something very drastic has happened to it, they can usually be repaired, the encoder resolution can often be got from off the glass scale, but it might be very unlikely both motor and encoder were defective.
The message you get probabally indicates the unit is not homed.
Any sensor that may be on there for this is just to initially position it to an approximate home posn. and then the motor will continue until the Z marker pulse is seen.
Check things like brushes if DC motor.
BTW does the motor/encoder show any make/model?
Al.
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.