From my understanding, if you no links going to that url, it might be the crawler verifying existence of the 404 page.
So displaying a 404 page is best option for that.
However, if you have links going to that url, you should either fix those(if internal) or do 301 redirect as you said.