The bug was that particles were not inheriting the object's velocity, because the old function was using particle coordinates to calculate object velocity rather than the object's.
I calculated the objects velocity using FCurves, as suggested in the task description.