Is it illegal for a witness to consult a lawyer in a case investigation?

You can't.

At present, China's law does not stipulate that when interrogating a criminal suspect, a lawyer can be present to accompany the interrogation.

1. Interrogation of criminal suspects must be conducted by investigators of public security organs or people's procuratorates. In order to improve interrogation efficiency, ensure interrogation quality, and prevent and guarantee interrogation safety, there shall be no less than two investigators during interrogation.

2. For a criminal suspect who does not need to be arrested or detained, he may be summoned to the designated place of the city or county where the criminal suspect is located or to his residence for interrogation, but he shall produce the certification documents of the public security organ or the people's procuratorate.