Section 20C. In any investigation or proceeding before a grand jury, or in a criminal proceeding in the supreme judicial court, appeals court or superior court involving any offense listed in section 20D, a witness shall not be excused from testifying or from producing books, papers or other evidence on the ground that the testimony or evidence required of him may tend to incriminate him or subject him to a penalty or forfeiture, if he has been granted immunity with respect to the transactions, matters or things concerning which he is compelled, after having claimed his privilege against self-incrimination, to testify or produce evidence by a justice of the supreme judicial court, appeals court or superior court, as provided in section 20E.