Discount code = free order = bug

I think you should create a payment method “free” and add a rule to it.