I have working solution using Cart API but out of 50 orders 2 or 3 orders do not contain that free product. So I guess, it will be 100% if I use Script Editor to insert free product into cart items.
Shopify Scripts can not add items to the cart.
You'll need to look into ways to make you current process more reliable. What steps are you taking to ensure the product is in the cart before moving to checkout?
If user delete that free item (price set to $0) then cart page is refresh and my code on cart page again execute which add thre free product again.
Should I write same code on checkout page ? to ensure that Free Product in available in cart?