The command probably does not take its pathname argument in the same format that you expect, so it was deleting the parent directory of the directory that you thought you were deleting.