I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.
Issue:
Some functions are running after page refresh, but those are not working properly after actions like submit or cancel, etc. on the application side.
If we run the application directly without a gateway setup it is working fine. But if it is running through the gateway even if I disable the WAF these backend events are not working.
Solution:
You have overcome this issue by manually reloading the page after the post-event of application action buttons.
Thanks,
Sai.