Getting same error.
This works like a charm, thank you! I’ve been looking for exactly this solution.
It does show free products on the checkout page, but:
1) no error message when gift is not selected
2) and most importantly – doesn’t proceed to PayPal even if gift is selected
Are there any updates on this? Having the same issue as topic starter.