Diaz’s departure comes amid a police department staffing crisis and several lawsuits alleging sexism and racial discrimination.