Oh dear you did get into a pickle! If the door works when open , ie the handle lifts and the key turns , then the problem is of alignment between the door and lock strikes on the frame. Often the doors drop and this causes the problem locking. You have undone the screws which hold the hook/bolt case...