To better understand me, I'm leaving you with a img.

In the picture above you can see that I don't get a 404 error, but only a "File not found" message, although I should get an Error 404.
Below I leave another image where I get a 404 error because it is a folder and not a file.

So when it comes to a folder, Error 404 works properly, but when it comes to a file (first image), then Error 404 doesn't work, I just get a simple message "File not found".