is it possible that python .add_driver command cant create f-curve?
I found the problem, with the python command .add_driver the generator modifier is automatically generated (m.f.!).

If you want rid of it, you can use
mod = bpy.data.objects[&quot;Armature&quot;].animation_data.drivers[0].modifiers[0]
bpy.data.objects[&quot;Armature&quot;].animation_data.drivers[0].modifiers.remove(mod)