Federal court judge admits 'error' when jailing man in routi