Steps to reproduce (see gif):
1. Create your Account and Account Group, add your Account to the Account Group
2. Create on more Account Group but do not add your Account to it
3. Create new Discount in Control Panel -> Commerce -> Discounts
- apply to Shipment
- check your channel
- add all available account groups
- This probably isn't relevant but my discount had setup Coupon Code, use percentages...(see gif!)
4. Add any product to cart, checkout, apply Coupon Code, go through all checkout steps
The shipping discount is applied to the order.
No discount is applied to the order.
Removing extra Account groups (and leaving only the Account group your Account is part of) from Discount definition fixes the problem.