The positional operator did not find the match needed from the query

trying to update/upsert into subschema. getting this error:

The positional operator did not find the match needed from the query.

db.collection.updateOne( { _id: leadId, "listings.listingId": listing.listingId }, { $set: {"listings.$.primary": data.primary, "listings.$.deleted": data.deleted}}, {upsert: true} );
any enhancement to this or any another way that works ?