Android 6.0 update - System UI not working I updated my Z5 to Marshmallow 6.0 yesterday. Worst mistake of my life.

It locked out my phone and wiped some SD photos (so I couldn't get past the keylock screen - on entering the correct code, it goes black momentarily, thinks about it, then returns to the lock screen on a never ending loop). Clicking any notifications fro the dropdown menu brings up the keylock screen again, and on inputting the correct keycode in, I get the error message 'unfortunately, system UI has stopped working' then it returns to the locked screen again.

I can receive calls, emails and texts...but I cannot access them, or send anything. 

Worth noting that I already did a factory reset (and lost further photos from my sons 5th birthday), which fixed the problem last night...and this morning it return in the same manner as above. 

About to do a further factory reset, but that's no way to live my life with a 3 month old phone....

Someone please help (And also any help on recovering my SD images would be welcomed!)

I have been to x2 O2 stores, with one Guru who couldn't' find a solution.

THANKS!
Maria
When this type of problem happens (I've seen it happen more than once where the unlock code stops working).  Go to Google's Android Management and change the code.  This has cured the problem twice for my clients.

There are a number of ways to get to Google's Device Manager.  One ways is:

http://play.google.com -> Click on the Gear icon at the top right corner of the screen -> Click on Android Device Manager -> Login -> Select your target phone (if you have multiple devices) -> click on Lock.  Follow the prompts to change/set your lock code.

So far this has worked to resolve the issue.  I'm not sure if something specifically has to be done to enable this feature, but since you are experiencing problems, you might consider testing the steps when you're not experiencing the immediate problem so that you can verify that it will be available the next time next time you need it.