Mongodb 4.2, aggregation query with merge is taking longer time and being run as single update operation for each of matching records

We have a aggregate query with merge similar to below with update operation for $set. Expectation is that this update will be run through aggregation. But looking through logs, it is sometimes run as single update operation for all matching records with IDHACK in queryplan. This is causing unnecessary delay to pipeline execution.

        $merge: {
            into: 'target',
            on: '_id',
            whenMatched: [{
                $set: {
                    fieldA: '$$new.fieldA',
                    fieldB: '$$new.fieldB'
            whenNotMatched: 'discard'

Any thoughts? Any pointers to how aggregation merge with $set works behind the scene would be helpful.