The IPC 1860 was replaced by the BNS 2023 (in force 2024-07-01); no verified section mapping on file for Section 77 — confirm the corresponding provision (savings: Section 358, BNS 2023).
Nothing is an offence which is done by a Judge when acting judicially in the exercise of any power which is, or which in good faith he believes to be, given to him by law.