Reconstructing networks with unknown and heterogeneous errors