Police departments have fought legal battles specifically to avoid having any duty to protect civilians or to prevent a crime in progress if they so choose.[0] I do agree with you that they (not just in SF, but across America broadly) have in fact obviously failed on all levels, though.
You don't see a link between a police force which actively rejects duty to protect and a police force that doesn't value prevention? It certainly seems to me that a police force which refuses to prevent crimes that are being carried out literally in front of them is one which places low value on prevention.
That isn’t what the law has determined though. The law has only determined that police can’t be sued or imprisoned for failing to assist. It can be my job to pick up trash, but that doesn’t make it my legal obligation even under threat to my own life.
[0]: https://www.findlaw.com/legalblogs/law-and-life/do-the-polic...