Initially, I also thought so. After the above experiments, I think there is a problem somewhere (probably due to floating point precision), and  most probably the problem is in the batchnorm layer, since the distance is proportional to the difference in batch size, and the distance is zero when the batch sizes are the same (see 512 vs 512).