The ballot is rejected if multiple parties receive votes in a primary.
To choose your party at polling time sounds reasonable, so reasonable that there has to be a gotcha.