I found the root cause here; it's a rare case, due to shared doc stores. Whenever the merge must merge doc stores and at least 1 segment is referencing the currently open shared doc stores, IW must flush. It's an "unusual" flush because it's triggered by the right merge and not maxBuffereDocs/RAM being consumed.
When this happens we fail to check for newly required merges, which can then leave the index in a state where it needs a merge, causing this failure.
I can't repro this failure, but I think very likely this is the cause. The fix is to call updatePendingMerges in the two places where we do these "unusual" flushes. I'll commit shortly.