That custom 404 page doesn't give a lot of information, it doesn't help that it redirects to 404.html. Maybe the redirection isn't working. The normal way to redirect though is to send a Location header with the new URL. But, for testing, I would suggest not redirecting and making sure the PHP code works. Your PHP code has some errors in it, so maybe the server sees the PHP errors and redirects to 404 for some reason.
Here are some of the issues with your PHP code:
You're trying to call a function called $POST, but $POST isn't defined. If you want to get submitted values you get them from $_POST, which is an array, not a function. So, for example, you would use $_POST['name'].
If your database connection fails you don't stop the script, the rest of the code still runs without a database connection.
When you call mysqli_query, you used !$con which is going to send a boolean value instead of the actual connection.
You need to use prepared statements when you're sending data to the database. The mysqli extension supports prepared statements, you need to use them to make sure your queries run and protect against SQL injection attacks.
You send the same text ('Not inserted') regardless of whether or not the record was inserted in the database.
If you use echo to send any output, sending a header after that will not work.