This question already has an answer here:
It has most certainly happened to all of us at least once: Two people walking along the same narrow pathway in opposite directions walk into each other.
There is room for both to pass each other, but person A shifts to their left to avoid B, and B shifts to their right (i.e., A's left) in order to do the same thing, so they're still on a collision course.
They both realize the mistake and they both try to correct it by moving to the opposite side they did before, so the problem persists.
Rinse and repeat 3 or 4 times until one of the parties realizes: "I'll stick to the left (or right) no matter what, and let him pick the other side!", in a sort of perverse human feedback loop.
Is there a word or idiom to describe this situation?