Hugo and 404 pages

Hello everybody, I just started using Cloudflare to test out Hugo and I have found a weird behavior.
Locally I am able to see error 404 for non existing pages, but once the website is deployed in Cloudflare it looks like all the expected 404 are really a 200 but redirected to the homepage.

I just wanted to know if it is the CF worker doing it or if I have made a mistake somewhere.

Thanks to anyone who will respond!