The item in this case is a credit card processing fee which is a percentage of the total invoice, so it doesn't have any shipping cost, but adding it manually triggers a shipping calculation, and adding it via script doesn't calculate the percentage of the total, so it doesn't have an amount to add to the invoice.