A detective with the Essex County Prosecutor’s Office filed a lawsuit on Wednesday claiming he endured severe retaliation and a hostile work environment after he reported misconduct within the agency.