magento2 – Magento Graph QL : Unable to Apply Coupon as its marked as applied even before placing an order

We have as site where admin is running on Magento while frontend is running on PWA which uses graphql mutations.I am facing the below problem. Please find the below steps

  1. I have a Welcome coupon configuration where a customer can use the coupon only once
  2. Apply that coupon in the cart
  3. Navigate to the last step of checkout page
  4. Then make any of the product in cart to outofstock
  5. Click on Place order,it will redirect to cart page showing “Some of the products are out of stock” which is valid one
  6. But now i can no longer use that coupon.When i check the DB tables,an entry is created like the coupon is already used.PLease refer below screenshots

enter image description here

If we remove those entries in the DB table,we can again use it.

Any suggestions on how we can debug/fix this

Thanks in advance