The issue was that when adding a constraint through python to an object that is already animated, the constraint did not evaluate properly at first. The fix is to update the depsgraph when creating a constraint through the API. Such an update already happened when running the operator to create a constraint. Pull Request: https://projects.blender.org/blender/blender/pulls/122198