Trying to understand coordinate spaces in python
Force an update.
Using the add empty object operator (or any operator) has the side effect of forcing a view_layer update.  In version &lt; 2.8 this was a scene.update().
It can be the case in a script execution that object matrices are not yet updated when their values are being queried.
Updating the viewlayer in the same loop as the operator produces the same result as with operator, without operator. (circa line 30)
pCounter = 0
for pair in combinations(list(pointDict.keys()),2):
    pCounter = +1 # Did  you mean += 1
    bpy.context.view_layer.update()  # &lt;== UPDATE
    objA = bpy.data.objects[pair[0]]