Good day!
I use strategy to handle 404 errors like this: Error handling for ASP.NET MVC 2 and IIS 7.0 or this: How can I properly handle 404 in ASP.NET MVC?
It seems I have fixed it by setting in Web.config:
Web.config
<httpErrors existingResponse="PassThrough" />