Generally, a voluntary statement to law enforcement isn't automatically invalid, but its use in court is a tricky matter. The vital factor is whether it was obtained fairly. Officers must adhere to specific rules, https://panchanandshaw.com/blog/costs-imposed-by-court-explained/