That really doesn't mean shit since it anecdotally works to all the folks that have had UTIs. Whether the causal effect is indirect is really asides the point. It works.
Cranberry juice is no more effective on UTIs than chicken soup on colds and flus. That is, it can have an impact in part because of the placebo effect (which is substantially more powerful than is currently understood), but it is not because there is any inherent benefit to cranberry juice ("chicken soup" — that is, any clear broth — is at least partially effective because it’s warm liquid fighting diseases which cause dehydration; there’s no medicinal benefit).
Your logic is kinda faulty...