That is a pretty good summary of how the TSA cannot seem to operate with any sort of process efficiency or consistency.
What should happen? The TSA inspection should take place before the bag goes into the handling system and in the owner's presence at the carrier's check-in desk.
What does happen? Just about anything else, as the OP described it, including TSA violations of Federal firearm transportation regulations and contravention of common sense.