OK GUYS!
So let me tell you that you can't change their name or gender
BUT I've been thinking for those people who accidentally moved their sims in and changed their last names.
well just thinking but maybe if you moved a temporary sim with random stuff BUT THE LAST NAME YOU WANT THE other people (the ones you accidentally moved out)
to get move this temporary sims into the other person/couples house (the house you want him and/or her to live in) then ask the person/couple to move in and then get the temporary sim to leave town.
Hope you get me