I think the OP must have been a CQI passenger at BKK, correct? I've never done the CQI routine, as my airport (Khon Kaen) is not considered International (yet). Anyway, for those doing the CQI routine and connecting at BKK to Phuket, Chiang Mai, and other supporting airports, is the procedure that you clear immigration at BKK, then clear customs at your destination airport? Guess I thought they would do both immigration and customs at the destination airport.
I'm also surprised to hear the CQI's are required to complete a customs declaration, as that is something that passengers disembarking at BKK don't have to do. (They only have to submit the TM6 Arrival/Departure card.)