If SOCl2 reacts with alcohols via SNi, why doesn't POCl3?
The step in the red box is wrong. You probably get dissociation to form an ion pair. The pair quickly collapses, leading to chloride attack on the cation before any dissociation or diffusion occurs so that you get the retention of stereochemistry.

For phosphorus based chlorination, this ion-pair mechanism is probably not favorable, though it's not clear to me why this is the way it is.