I had exactly the same problem,the patio door wouldn't lock when closed but the lock would work when open.
Anyhow,the opposite patio door has a small silver plate with a screw above and below which the faulty door lock fits in.The plate had come loose and just needed to be pulled out to...