Sessions, which have ever had retryable write operations run on them (i.e. operations with txnNumber/stmtId) require the complete transaction oplog chain for the most-recently executed transaction to be available so that the executed statements can be loaded and cached.
If the oplog rolls over and part of that transaction's chain is lost for such a session AND the session gets dropped from the cache for any reason (be it step-down, restart, direct write to config.transactions, etc), from that point onward that session will become unusable and all operations using it will start failing with error code IncompleteTransactionHistory (217), regardless of whether they contain retryable writes or not.
NOTE: The problem will go away once the session gets cleaned up as idle.