NSW Health has issued a major warning after five people who used what they thought was cocaine were hospitalised for heroin overdoses.