I need some help finding exact articles on how the following application would be a code violation:

A disconnect with one auxiliary contact was ordered for a job. Going to the Disconnect from a control panel was 480VAC, 4/C #12 SH cable for the motor, 2#12 conductors for the disconnect auxiliary contact, and 2#12 conductors for the motor thermal switch. The 2#12's for the disconnect were wired to the auxiliary contact in the disconnect. The 2#12's for the motor thermal switch were wired directly to the mts but were routed through the disconnect. So, when the auxiliary contact for that disconnect is opened it takes out the motor but the motor thermal switch is still live.

Thank you for all of your help.