I get the feeling just estimating $Z is a major task, and needs to be done for every customer. So I'd guess the next 'Groupon with AI' would need to be structured around helping businesses that use them minimize $Z.
I think it's a good market actually - but it's going to need a lot of finesses and expertise. The groupon method of bludgeoning businesses with quantity didn't turn out to be correct.
That's not always true. I rarely use a groupon alone and ending buying addons at the regular price. You might lose money in one item but win in another. That's why retails focus in bringing you to the store not matter what.
I think retails focusing on bringing people into the store is different for an important reason - when you're inside the store and buying something, it's almost guaranteed that you want a few other things too. You could jump between 10 stores all with different specials to get all of them cheaper but that's incredibly time consuming.
Groupon however is trying to get return customers. It's not about someone doing Scuba diving picking up a few extra scuba diving lessons while he's there - he has to actually come back later. It's no longer an impulse 'easiest path' purchase that retail focuses on by getting you in their store and not the store down the road.
EDIT: I think you might be right that it could work though. It's a numbers game. If you lose $X in groupon charges but gain $Y in new customers then it's a net win for the business. However, you also lose $Z from existing customers (lots of obvious reasons here). So you need $X to be small enough - and obviously that isn't the case with Groupon. However, there's no reason why a company couldn't work that uses customization to supply the 'right' individual with a coupon instead of everyone with a coupon. Credit history? Tip history? Recurring business history?
'Groupon with AI' might be what we need here?