Quite a common problem .. more common in the summer.
UPVC expands in the summer due to the heat. When it expands the bolt or latch may drop out of alignment, only by a millimetre, but this could be enough to stop the lock from engaging.
To check this fault my first thought would be ..
Open the door and insert the key in the lock ..
If you normally raise the lever to lock the door .. do that now.
If the mushrooms, hooks and bolts on the edge of the door all rise easily, then your locking mechanism is okay.
That means that the fault lies in the alignment of the door with the frame.
As a rule this is altered by the hinges.
Without seeing your door my guess is you would adjust the top hinge initially by un-screwing (yes anti -clockwise) the 5mm hexagon screw.
It's difficult to explain but the top of the door needs to be drawn back towards the top of the frame .. ( unscrewing draws it back)
If this eases the door and the lock engages do the same with the middle hinge, only not as much.
Keep checking the lock to see if it becomes easier as you unscrew the adjusting bolt.
One more tip is get some Vaseline on your finger and wipe it around all the locking points on the edge of the door (bolt ,hooks and mushrooms), this will ease their engagement with their counterparts on the door frame.
They too will benefit from a smear.