Under a traditional JCT contract, if a contractor acts on instructions given by a mechanical services consultant, what are the legal ramifications?

Neither an engineer or a consultant is entitled to make such a decision. Consultants should give the architect a note of instruction when required, and only when the architect is satisfied that such an instruction is required should one be issued. A consultant that gives direct instruction to a contractor has broken the terms of the building contract. An architect should not go along with the scenario in the question under any circumstances.