Skip to content

Magento 2.4.2 – allows more products in cart then in stock

We have a problem on our website, since we added plugin for preorder/backorder we made some changes with extra php script. I checked the code it does not infect any settings for this.
But for some products (not all) if there is let’s say 50 in stock and I want to put them 51 (or more) in cart it allows me. But for others it says that this amount of qty is not available.
I checked both of the products have same settings applied and scripts ran. Advanced inventory is the same (no backorders, etc…)

But if I delete this not working product and add it as new then it works…

As you can see in image, product snow qty=37, it allows me to put in cart more then 37.
enter image description here

Any suggestions?
We have a problem that orders get through without correct qty of items in stock.
Thank you in advance