The Code of Criminal Procedure, 1973 (CrPc)
269. Officer in charge of prison to abstain from carrying out order in certain contingencies.
Where the person in respect of whom an order is made under section 267, –
(a) Is by reason of sickness or infirmity unfit to be removed from the prison or
(b) Is under committal for trial or under remand pending trial or pending a preliminary investigation; or
(c) Is in custody for a period which would expire before the expiration of the time required or complying with the order and for taking him back to the prison in which he is confined or detained or
(d) Is a person to whom an order made by the State Government under section 268 applies,
the officer in charge of the prison shall abstain from carrying out the court’s order and shall send to the court a statement of reasons for so abstaining:
Provided that where the attendance of such person is required for giving evidence at a place not more than twenty-five kilometers distance from the prison, the officer in charge of’ the prison shall not so abstain for the reason mentioned in clause (b).