The issue is still the same, it appears even before any code executes. There is absolutely nothing in the code which can fix this.
https://prnt.sc/mlihif
I hope the issue is clear, I add any code it does not get executed in the 301 redirect.
the .htaccess is also clean, but the issue still remains that $_POST data is stripped out when accessing the page. This is something external to the whole wordpress setup. I am trying to find for answers as this is also new thing. Maybe the configuration of EC2 instance or something. Please give sometime to find an answer for this.