I have had this problem twice now - the phone simply does this or a hard reset while charging. It's a total PIA because when you restore it, all sort of things need to be reauthorised or have vanished. What Apple person allowed this remote wipe/lock feature to be rolled out without testing that it wouldn't self trigger while simply charging and unattended is a mystery. But it's a sign of arrogance on Apple's part that they rolled it out as an update without proper testing.
This has nothing to do with entering the wrong password - the phone just goes locked by itself, with no manual inputs, while charging. And Apple's approach seems to be to deny the problem.
By the way, anyone asking if you backed up recently is a person without a sense of self preservation...