This approach may work well for points that are close to the training distribution. The prediction of the neural network for points outside the training distribution cannot be trusted a lot. It may happen that for points outside the training distribution the predictions of the neural network are somewhat strange and erratic. For more information on this topic have a look at this paper:
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1176122
Under the "IMPROPER BEHAVIOR OF MLP OUTSIDE THE BOUNDARY OF THE TRAINING SAMPLE" paragraph, you will find more information on this problem.