Originally Posted by infinitigor
since it failed inspection its possible they were modded, and if BMW knows they were modded than there is no more factory warranty on engine related issues.
It's possible that it was modded, but any number of items equally as possible -- depends on the state of course, but I have seen Carfax say "failed emissions inspection" even if the reason for failure had nothing to do with actual emissions (example: tires worn out, crack in windshield, turn signal bulb out, tint too dark, etc).
A few years ago I purchased a Jetta that had been stolen from the dealership and recovered next day. Had no issues with the car, and no issues getting it insured.