Mine does this.
Try this if inside:
Pull the door using the internal door handle as normal,
gently until it 'clicks' into the first click so it's on the safety catch bit where it's not properly shut but isn't going to fly open.
Then tug it shut quite firmly using the internal handle. It should then shut properly. Lock it using the central locking button by the radio to make sure that the nob thing in the door goes as far down as it should - if it does then you are then ready to drive

If the nob bit only goes half as far as it should, re-open as normal and repeat the procedure until it does.

(probably just need to be slightly firmer on the tug LoL)
If you're outside:
Push the door gently shut so it's on the safety latch. Then place your hand on the door pillar (the black vinyl bit) just above where the actual doorskin starts and push the door briskly and firmly into the proper shut position. Zap with the key. Check it's properly locked by looking at the nob inside and check the door with the handle.
It should now be locked and secure
Mine's done this like forever... lol