agree with ^
However the Nissan dealer that checked it out and said it was mint, how did they convey this information to you? Through email? Do you have records of their statements that the car was in mint condition? Also do you have contact info from the BMW dealer stating the condition of the car or guaranteeing it?
If so, contact them both and inform them the car has prior damage and it will cost you to repair the roof and tell them they have to pay or contribute to the repair bill. If they say no, contact an attorney and show him the statements from both dealers, have him draft a demand letter to both dealers stating they violated (your state) law for falsifying information and misrepresenting material items in a contract. This should straighten them out and one will pay or contribute.
At worst, you scare the dealers and pay the roof yourself, at which point you sue the dealers through said attorney.
(this does not constitute legal advice)