Your problem was that strictly speaking you weren't in transit. The gate agent saw only a LAX-ZRH segment, which implied that your destination was ZRH, for which you didn't satisfy the entry requirements. If your ticket had been LAX-ZRH-IST, you would have been let through.