For locker rooms, my concern is that someone could pretend to be transgender for an excuse to see naked women and leer at them (though I doubt an actual rapist would be deterred by a sign). Also, the other people in that locker room may not know/realize that that person is transgender.
But doesn't the existence of homosexual people already lead to this being a potential problem? And like you said, a sign won't stop rapists.
Yeah, there's a host of issues that forcing people to use the bathroom/locker room of their biological sex doesn't solve, and another host of issues it creates. The status quo was really the best way with this.