@Nitin Parmar-Tss consultancy Thank you for reaching out to Microsoft Q&A.
Typically, These 500 errors can be caused by application errors or by any of other platform issues some of them are mentioned below
- If your app is consuming high memory or CPU.
- User Initiated Site Restarts.
- Site Crash Events due to multiple number of failed requests.
Looking at the screenshot you have shared look like the issue is from the web application code and The request is spending time in AspNetCoreModule which is the module that executes an ASP.NET Core request A request spending time in this module would indicate a delay incurred due to application code .I would suggest you to enable application logging in your webapp to identify the cause.
If the issue is happening intermittently then you can capture the profile traces using application insights to identify the performance issue. refer to this documentation for more information about how to enable and view the profiler data.
Feel free to reach back to me if you have any questions on this.