Some critical lines of code to return X,Y,Z with your DepthAI pipeline are as follows:
inDet = detectionNNQueue.get()
....
detections = inDet.detections
.....
for detection in detections:
print(detection.spatialCoordinates.x)
print(detection.spatialCoordinates.y)
print(detection.spatialCoordinates.z)
Somewhere in your code, you should be able to return the X,Y,Z components of depth for the object you're trying to detect. Hopefully this helps point you in the right direction and lets you verify the intended depth value.