It is not illegal to fail this test. Some of you seem to think you have to turn around and go home if you set this thing off, do you really work at airports each day? I think not!
It is no different to setting off the metal detector, it just indicates there might be a problem, and further investigation is required.
The idea is to simply search the person and baggage, including checked luggage, and if all OK on your way. (Although it is a pain in the ass with checked luggage though because that needs to be checked as well).