I struggled quite a while with this one and there was no specific indication as to what the problem was.
I had an HTML form which was submitted and after submitting it, WordPress would show a 404/Page Not Found. I knew it was the $_POST posted form data as the page did exist and accessing it without posted data worked fine.
It seems like WordPress has the “name” parameter reserved in $_GET and/or $_POST data so that caused the problem. Changing the “name” field to something else resolved the issue and the WordPress 404/Page Not Found was gone.