Discuss the legal implications of voluntarily causing hurt to extort confession or to compel restoration of property as outlined in Indian Penal Code (IPC 1860) Section 330: Voluntarily causing hurt to extort confession or to compel restoration of property and their relevant Bharatiya Nyaya Sanhita 2023 (BNS 2023) code reference.

{'IPC Section': '330', 'IPC Heading': 'Voluntarily causing hurt to extort confession, or to compel restoration of property', 'IPC Descriptions': ' Indian Penal Code, 1860 
330. Voluntarily causing hurt to extort confession, or to
compel restoration of property
Whoever voluntarily causes hurt for the purpose of extorting
from the sufferer or from any person interested in the sufferer, any confession
or any information which may lead to the detection of an offence or misconduct,
or for the purpose of constraining the sufferer or any person interested in the
sufferer to restore or to cause the restoration of any property or valuable
security or to satisfy any claim or demand, or to give information which may
lead to the restoration of any property or valuable security, shall be punished
with imprisonment of either description for a term which may extend to seven
years, and shall also be liable to fine.
Illustrations
(a) A, a policeofficer, tortures Z in order to induce Z to
confess that he committed a crime. A is guilty of an offence under this
section.
(b) A, a policeofficer, tortures B to induce him to point out
where certain stolen property is deposited. A is guilty of an offence under
this section.
(c) A, a revenue officer, tortures Z in order to compel him to
pay certain arrears of revenue due from Z. A is guilty of an offence under this
section.
(d) A, a zamindar, tortures a raiyat in order to compel him to
pay his rent. A is guilty of an offence under this section.', 'BNS Section': '120', 'BNS Heading': 'Voluntarily causing hurt or grievous hurt to extort confession, or to compel restoration of property', 'BNS description': 'The Bharatiya Nyaya Sanhita, 2023
120. Voluntarily causing hurt or grievous hurt to extort confession, or to compel restoration of property.
(1) Whoever voluntarily causes hurt for the purpose of extorting from the sufferer or from any person interested in the sufferer, any confession or any information which may lead to the detection of an offence or misconduct, or for the purpose of constraining the sufferer or any person interested in the sufferer to restore or to cause the restoration of any property or valuable security or to satisfy any claim or demand, or to give information which may lead to the restoration of any property or valuable security, shall be punished with imprisonment of either description for a term which may extend to seven years, and shall also be liable to fine.
Illustrations.
(a) A, a police officer, tortures Z in order to induce Z to confess that he committed a crime. A is guilty of an offence under this section.
(b) A, a police officer, tortures B to induce him to point out where certain stolen property is deposited. A is guilty of an offence under this section.
(c) A, a revenue officer, tortures Z in order to compel him to pay certain arrears of revenue due from Z. A is guilty of an offence under this section.
(2) Whoever voluntarily causes grievous hurt for any purpose referred to in subsection (1), shall be punished with imprisonment of either description for a term which may extend to ten years, and shall also be liable to fine.'}