Although quite extreme, this is a standard official Punta Cana airport security procedure and not illegal activity. They can take as long as 30 minutes or more depending on what they discover. Once they have determined you are innocent, they will walk you back to the terminal and you are free to go.