At what point is a "licensed" contractor/sub to not be held responsible for not adhering to code and the CDs?
That answer depends on the nature of the contract they signed with the owner. But for sake of discussion, let's assume that they are using the standard AIA-A201 General Conditions of the Contract for Construction:
§ 3.2.2 Because the Contract Documents are complementary, the Contractor shall, before starting each portion of the Work, carefully study and compare the various Contract Documents relative to that portion of the Work, as well as the information furnished by the Owner pursuant to Section 2.2.3, shall take field measurements of any existing conditions related to that portion of the Work, and shall observe any conditions at the site affecting it. These obligations are for the purpose of facilitating coordination and construction by the Contractor and are not for the purpose of discovering errors, omissions, or inconsistencies in the Contract Documents; however, the Contractor shall promptly report to the Architect any errors, inconsistencies or omissions discovered by or made known to the Contractor as a request for information in such form as the Architect may require. It is recognized that the Contractor’s review is made in the Contractor’s capacity as a contractor and not as a licensed design professional, unless otherwise specifically provided in the Contract Documents [e.g., design-build components].
§ 3.2.3 The Contractor is not required to ascertain that the Contract Documents are in accordance with applicable laws, statutes, ordinances, codes, rules and regulations, or lawful orders of public authorities, but the Contractor shall promptly report to the Architect any nonconformity discovered by or made known to the Contractor as a request for information in such form as the Architect may require.
§ 3.2.4 If the Contractor believes that additional cost or time is involved because of clarifications or instructions the Architect issues in response to the Contractor’s notices or requests for information pursuant to Sections 3.2.2 or 3.2.3, the Contractor shall make Claims as provided in Article 15. If the Contractor fails to perform the obligations of Sections 3.2.2 or 3.2.3, the Contractor shall pay such costs and damages to the Owner as would have been avoided if the Contractor had performed such obligations. If the Contractor performs those obligations, the Contractor shall not be liable to the Owner or Architect for damages resulting from errors, inconsistencies or omissions in the Contract Documents, for differences between field measurements or conditions and the Contract Documents, or for nonconformities of the Contract Documents to applicable laws, statutes, ordinances, codes, rules and regulations, and lawful orders of public authorities.
So, in the example in this thread, if the architect had a floor plan that contained an inherent code conflict (door clearance vs. lavatory location), it is not the contractor's problem. But let's say these same plans also had (A) a door schedule that called for latch and a closer, and (B) a standard detail that showed door strike side clearances and it said 'add 12" on push side for door equipped with closer and a latch':
Scenario #1 - The contractor follows the floor plan and schedule, does not notice the inherent conflict between plan, schedule and standard detail, and it gets built in a non-code-compliant manner: The contractor is not liable to fix the problem; the responsibility rests with the architect.
Scenario #2 - The contractor notices the conflict during construction, and sends an RFI: The contractor is not liable for the cost or time to fix the problem; the responsibility rests with the architect to come up with a code-compliant solution.
Scenario #3 - The contractor notices the conflict prior to installation, but says to himself, "hey, I'll make more money if I build it first, then point out the code problem, then get paid to tear it out and rebuild it again": The contractor is then liable for the difference in cost in design solutions of when they knowingly should have reported it vs. when they did report it.