Baryon number $U(1)_B$ is anomalous in the Standard Model, as can be seen by computing a $U(1)_B SU(2)_L^2$ triangle diagram. This implies that $$\partial_\mu J^{\mu B} \sim W_{\mu\nu} \tilde{W}^{\mu\nu}$$ where $W_{\mu\nu}$ is the $SU(2)_L$ field strength, which allows the nonconservation of baryon number by topologically nontrivial field configurations.
According to Schwartz's QFT textbook, all other contributions to the $U(1)_B$ anomaly vanish, but I can't see why that is. In the case of $U(1)_B U(1)_Y^2$, we should have a contribution proportional to $$\sum_{\text{LH quarks}} Y_i^2 - \sum_{\text{RH quarks}} Y_i^2 \propto 2 \left( \frac16 \right)^2 - \left(\frac23 \right)^2 - \left(-\frac13\right)^2 \neq 0.$$ What am I doing wrong in this computation?