I was having this issue just in my production environment. I have an icon that is in my static files. I can load it through https://mydomain/static/img/favico.ico, but at the same time I get a 500 error for the following url https://mydomain/favico.ico . <- this url does not exist in my project.
I can't replicate in my local environment. I already did collectstatic.