Out of curiosity, did you try to use the other key? Sounds to me like the key may be defective and loosing the program.
As far as "Lemon Law" stuff goes, been there done that with Cadicrap. Bottom line is Manufacturer comes equipped with Lawyer. Burden of proof is on consumer. If you can't reproduce the problem in front of the arbitrator, you lose.
Try to work it out with the dealer. If the car dies again, press that little wrench button and let them send a tech out to you.
just my $0.2
00 AMG E55
96 DCM Impala SS
81 Corvette Cpe