I´d never had any casualties from moving my cavalry head on through my own phalanxes.
What might happen is that moving through the other units your cavalry is slowed down and thus doesn´t get the full charge bonus.