In the canonical account there is no indication that for the bhikkhu to become female is the result of bad karma, or that for the bhikkhuni to change into a male is the result of good karma.