Cannot continue txnId -1 for session in MongoDB shard

Occasionally I’m facing with this error: 251 (NoSuchTransaction): 'cannot continue txnId -1 for session. And it aborts a transaction.

My enviroment:

MongoDB 4.4 bitnami shard (https://github.com/bitnami/bitnami-docker-mongodb-sharded) Scala MongoDB driver 4.4 (mongo-java-driver/driver-scala at master · mongodb/mongo-java-driver · GitHub)

In mongodb documentation they stated “On sharded clusters with multiple mongos instances, performing transactions with drivers updated for MongoDB 4.0 (instead of MongoDB 4.2) will fail and can result in errors, including”

Both my MongoDB and driver are 4.4. What else could be problem?