Without the casing on though it opens and shuts with no issue?
I've seen similar errors before to the one you describe. There is a small toggle switch that is held in place near the motor inside the drive. It has 2 wires running to it from the board. If the plastic holding it is is damaged it can cause issues like this. Check to see if it is loose. Another cause would be something blocking the tray from going all the way in but if you have completely removed the metal top and bottom case and see no loose debris stuck any wear I can not think of any other issue that would allow it to work with the case off.