That's a real issue. If you're on a student visa, and were planning on coming back in the fall, leaving the US for the summer may be a bad move. Entry to the US can be denied arbitrarily. Deporting someone is harder.
Sure, I was locked up by DHS/immigration, and I am a US citizen. CBP/ICE/HSI doesn't really need much of anything to lock you up, when they did it to me they told me I wasn't even under arrest.