When I am using ESR js 4.20 its working fine. don't know why its not working when Using ESRI Javascript 4.21 or higher is getting 404 errors when looking at areas that are not covered by the mosaic.
Go to this links this is my old code link In which I have used ESRI 4.20 version and its working fine.
Troubleshoot steps:
Go to this links (this link I am getting issue 4.21)
Open up Dev tools (you likely need to clear the console and any network traffic)
Pan East until you get to the edge of the mosaic. (try to drag map left to right)
You will start getting 404 errors