Generally, a free statement to officers isn't immediately unlawful, but its use in court is a complex matter. The key factor is whether it was obtained legally. Police must adhere to specific guidelines, including https://panchanandshaw.com/blog/court-law-guide/