Hi @glx77 , thank you for looking into this. Previously I as using admin-ajax.php and a callback function for the Ajax calls. Which was causing the issue. Now I have changed the code to work without admin-ajax.php. Though I don’t know what exactly was causing the issue. In the network it was showing 301 redirection and too many redirections.
If you have any idea what was causing the issue kindly let me know. It will be helpful for future implementations.