This is necessary when adding a new keyframe to an fcurve that also has a driver.
The purpose of this assert is to ensure evaluate_fcurve_driver() is used for driver f-curves instead of evaluate_fcurve().
It was added in rB4e845e06704b: Py-Driver: add 'self' option, apparently because driver f-curves require extra parameters to be evaluated.
So I guess this is not quite the correct solution, but difficult to say what is without more context.
Driver-fcurve evaluation happens in two stages. First the driver is evaluated, and then the result is used as frame for the normal fcurve evaluation. However, when changing the fcurve of a driver-fcurve, the result of the driver is not needed, therefore the additional parameters are not needed as well.
Maybe a better solution is to create a new function like evaluate_fcurve_pure which does the same as evaluate_fcurve but without the assert. I don't have a better name for this function right now..