IIRC the first prison in the US was established in Auburn, NY specifically because slavery had been outlawed and some sociopath was like “ok, yeah, technically, but if we just convict them of a crime first...”
Prison slavery existed before chattel slavery was rerouted through the prison system.