Topological anomalies in the off-diagonal Ehrenfest theorem and their role on optical transitions in solar cells