I wonder if it’s the same root cause as writeConcern is not allowed within a multi-statement transaction, though in that case I don’t think it was intermittent.

What version of the server are you connected to?

Otherwise, it could be an issue in Spring Data MongoDB, perhaps similar to this bug in Mongoose, or in the MongoDB Java driver itself. Which version of the Java driver are you using?

Regards,
Jeff