Fix bug DNN-3645: get custom error node with location wrapper check correctly.