It is possible that the new latch may be defective.
The only other possible problem is the control board is not working properly. Unplug the unit to reset the control board for about 2 minutes. If it still doesn't sense the door lock, replace the control board.