New York had a law that prohibited "loitering for the purpose of prostitution".
However, police applied a very broad interpretation to this law, singling out individuals who appeared to be men wearing provocative women's clothing, and searching or arresting them based on extremely weak evidence, like for standing too long on an area of the sidewalk, or appearing to wave at a car.
https://www.npr.org/2021/02/03/96351302 ... -trans-law
New York Repeals 'Walking While Trans' Law, NPR, Jaclyn Diaz, February 3, 2021
Some trans women, after being searched, have been arrested simply because police found a couple of condoms in their purse. The fact that they had three condoms in their purse is taken as "evidence" they were involved in prostitution.
Advocates of trans women say police do not understand their subculture well, and often assume that a man wearing flamboyant women's clothing is a prostitute. Many of these trans women are poorer Black and Latino people who do not have a car for transportation, so are more likely to be picked on by police as they walk the sidewalks.
New York decided its law was leading to discrimination against trans women, so its law was finally repealed.
The overall bigger legal issue here is that, sure a law can be passed to criminalize something, but then the question becomes exactly what sort of things will be taken to constitute "evidence" of that crime?
What often happens is that certain minority groups of people end up getting targeted and will suffer because of the existence of that law, and its interpretation, even though those people are not breaking the law.
People who are simply doing something that's not commonly done by the average person in the population. It could be someone growing plants indoors, who police mistakenly assume must be growing cannabis, it could be someone with a chemistry lab in their home, who police mistakenly assume are making drugs, or in this case, it could be trans women walking on the sidewalks along the street who police mistakenly assume are engaged in prostitution.