Sounds like your flange and gasket fell off while you were driving. They are only held in by friction.
EDIT: Correction, only the left one (driver's side) is not welded in place according to this thread.
http://www.m3post.com/forums/showthread.php?t=730274
Here's a replacement gasket if your test pipes did not come with them:
https://www.fcpeuro.com/products/bmw...ng-11627830668
Can't seem to find a part number for that flange. You might try asking Turner or the manufacturer of your test pipes as I believe the flange included on those are the same or at least made to the same spec.