Well, being hit on the head would explain a name like "?", if that had occurred first.

If you catch it soon enough, can't you rename all your villagers again, manually? I'm assuming this is just a temporary glitch, not a permanent inability to redefine names?
I've been lucky so far, I haven't had any of the glitches mentioned by others yet...