This is decision from Apex Court of India which held that,
“It bars the use of any statement made before a police officer in the course of an investigation under Chanter XII, whether recorded in a police diary or otherwise, but by the express terms of the Section this bar is applicable only where such statement is sought to be used at any inquiry or trial in respect of any offence under investigation at the time when such statement was made’. If the statement made before a police officer in the course of an investigation under chapter XII is sought to be used in any proceeding other than an inquiry or trial or even at an inquiry of trial but in respect of an offence other than that which was under investigation at the time when such statement was made, the bar or Section 162 would not be attracted.“
Khatri and Ors Vs State of Bihar and Ors on 10 March, 1981
Citations: [1981 AIR 1068], [1981 SCR (3) 145], [1981 SCC (2) 493], [1981 SCALE (1)531]
Indiankanoon.org link: https://indiankanoon.org/doc/705101/
Other orders made in this case are here.