I was asked to look into a site and it was having a similar problem. If I put through an order I got a 404. If I manually created a version of the page and then put through an order I would get a redirect loop.
After searching extensively I eventually got to this. @pandosia’s comment solved the problem.
How? Why is this hack necessary?