priority_takeover_two_nodes_equal_priority.js steps down node A and expects node B with equal priority to become the new primary. However, if for some reason node B isn't caught up in terms of oplog application, it's possible for node A to hand the election off to node C instead if node C is caught up, despite node C having lower priority.
The test needs to call awaitReplication() and wait for all nodes to apply oplog entries. See comments