To solve the not able to add items to cart issue on website and scenario to recreate the issue on website.
there are different scenarios may cause this issue.
1. When the quantity is not there for a particular item then the issue may arise.
2. it may come because od client script
3. and it may come when we use a in active item id in the code
4. when we use addline or addlines function in code it may come.
in my case i have added a minimum quantity in the search field set and i have commented the inactive item interid in the code after this i am n ot able to recreate the issue.
for me the issue was coming sometimes not regularly so able to find exact solution. may be gone after commenting the inactive item id in code.
added the minimum quantity in the search field set.

and commented the unused inactive id.

these two methods i have tried and solved the issue.