You did not fail for a safety reason
An exhaust leak by itself is not a safety issue unless it leaks or is directed into the passenger compartment.
You failed because it was not possible to give an accurate emissions test. In the US emissions are measured on a grams per horsepower ratio. If you have an exhaust leak it allows some emissions to escape their collection and detection instruments. This will reduce the grams per HP measured and if a big enough leak occurred it would allow a car that would fail to pass.
Moral of the story: if you can make a big enough leak that they can't detect or fits in a loop hole you will always pass.
__________________
|