Check overlapping in pose position
Try replacing the # Get the objects part of that script with the script below.
# Get the objects
ob1 = bpy.data.objects[&quot;Cube&quot;]
ob2 = bpy.data.objects[&quot;Suzanne&quot;]

# Get the evaluated objects
depsgraph = bpy.context.evaluated_depsgraph_get()
obj1 = ob1.evaluated_get(depsgraph)
obj2 = ob2.evaluated_get(depsgraph)

See types.Depsgraph