From my reading of client.bulk_write, it does not handle $clusterTime from error responses:
result = await self.write_command( bwc, cmd, request_id, msg, to_send_ops, to_send_ns, self.client ) # type: ignore[arg-type] await self.client._process_response(result, bwc.session) # type: ignore[arg-type] return result, to_send_ops, to_send_ns # type: ignore[return-value]
On error, write_command() returns this form:
# Top-level error will be embedded in ClientBulkWriteException. reply = {"error": exc}
So _process_response can't get the $clusterTime of the error.
This problem might not be unique to bulk_write. We should investigate if insert_one/find/coll.bulk_write have the same bug.