This test check compares a secondary's durable and majority timestamps. However, there's nothing to stop the secondary from doing additional writes, for whatever internal reason, that become durable, pushing that timestamp ahead of the majority point. The check for equality is unstable.
Also, improve debug-ability of non_durable_writes_on_primary_can_reach_majority.js by logging all timestamps it verifies