I don't know how precisely it translates into this situation, but there are several other distress codes where the coded nature only has to pass the harasser not "everyone". In aviation, the hijack code. In POW cases, blinking Morse code. In mall or convention security, calling the cops and asking for "Nora" ("Need Officer Right Away"). In law enforcement, 10-codes.
> I’m just saying I literally can’t imagine that being useful for stopping someone I’m afraid of committing crimes against me
Imagine that you're a typical stature (or even smaller) woman who is being harassed at a bar by a typical (or even larger) man. Imagine that the security staff has been selected and trained for their ability to provide security in a bar. You can't imagine how being able to communicate your need for security or assistance discreetly and unambiguously to them could possibly be helpful?
I don't think it's that a woman intending to get help with a harasser cares that "every female" knows the code phrase, just that the bartender and security staff do, and that it's going to be able to be unambiguously communicated to the staff before the harasser can intercept it. It's not a matter of shame where secrecy from all is important.