If you think the lock is malfunctioning, use a silicone lubricant to see if that helps it turn all the way. It would be a great lube for your outdoor application as well. Silicone spray is water resistant, it also protects items from moisture.
Don't use WD-40 on your locks. It may help to "unstick it" (if the mechanism is the issue). It won't lubricate it, and in time, will likely become difficult to operate again
If it's from the weight of the gate/door causing it to sag and preventing the lock from functioning properly, either adjust the strike plate to allow for some sagging. Or possibly tighten your hinges.
Hope it helps!
*(by the way, Maybe post some pics for reference?)