I cannot check myself right now but are you sure the difference is coming from the distance of B ? isn’t is the sequence on which the nodes are selected in JOSM (“select A, then B, then C” or “select A, then C, then B”) ?
Does selection sequence matter? I didn’t know that since my straightenings are done by area selections, or just click the points without regard of sequence. That would be news to me. I’ll check it out next time.