If the kiosk malfunctions, or if all kiosks are out of service, then you are supposed to be accommodated by the next available CBP officer at any of the primary inspection booths. The original officer was not following SOP in saying you had to go to the back of the line. I'm glad another agent found you afterward.