Had someone with authority said "Sir, unfortunately, the way the airport is laid out, you must enter the secured area of the airport in order to leave, and therefore we have to put you through our screening process." then there would be no trouble. Equally less troublesome would have been if the TSA had simply realized this and told the police "No problem, he's not connecting anywhere - please just escort him out of the building safely." That seems logical, and seems to be what happened in the end - as soon as someone actually made a decision.
If there is a worry about carrying concealed weapons out of the airport then surely the appropriate agency is the police. Why do the TSA have to do anything with someone who has disembarked and is entering US soil?