If the 40% off coupon scanned then it was allowed, so don't feel bad.
A month or two ago I went to Joann's to get some FQs on sale and got a piece of yardage as well, I had some other stops to make afterwards and it didn't really ding until later that the amount that rung up was too low, so I checked the receipt and the yardage wasn't rung up, so I went back, she found the yellow slip and it took some playing with the register to ring that up. I went back a few days later for some home dec. fabric and the same thing happened, the yardage slip bar codes weren't scanning (and the girl at the register hadn't realized it till I pointed it out).
I imagine they have that fixed by now but I wonder how much un-rung up yardage went out the door because neither register operator nor customer realized those slips weren't scanning.