Section 358(3) in Bharatiya Nagarik Suraksha Sanhita, 2023
(3)Any person attending the Court, although not under arrest or upon a summons, may be detained by such Court for the purpose of the inquiry into, or trial of, the offence which he appears to have committed.