Sorry to hear about this. Don't blame it on the BMW though

There was a thread on here about an M6 with over 140,000 miles on it and no problems. Most likely it was the first owner who really screwed something up and didn't take care of the car. This is one of the reasons I never buy used anymore for high end cars. Either lease, or buy new. I have always spent more money repairing used cars then what it would cost to buy new lol.
Anyway, see if you can take it to somewhere besides carmax to have the work done and if they will cover it under warranty. Most likely they will try to say it's not covered, but try to go through the paperwork yourself and convince them you did nothing wrong. They have to PROVE that there was negligence to not cover it. The proof doesn't have to be on you, but with them.
If they will write you a check for the work that would be best. Then you can go get the work done by people who know what they are talking about. Like a few said on here CarMax really doesn't know anything about this kind of car...and most likely the sales people ragged on it hard when it first came in. I am sure it's the highest end car they have ever set foot in.
I would go get the Dinan stroker if they will write you a check

Might take a lawyer and about $500 in letters from him, but it would be worth it.