When I've had that problem I've found it to be a build up of dirt on the various parts of the catch.
Are you sure the lock part actually works i.e. actually engages with the catch mechanism, I have also found pushing the handle inwards whist operating the key will help.
This was resolved by propping the lockers open, dousing the locks with WD40, letting it soak in, jiggling the locks then closing with a firm thwack. All of the external lockers were affected. Thanks for all the posts!