Membership 2 Registration gets stuck

Login to the site as a user and go to /membership page where you select yearly or lifetime membership and click "submit". The registration gets stuck at this point, the browser keeps "loading" the page and finally, there's a 504 timeout" error from nginx.

Further testing showed up that it's related to child-theme.