Debugging a page reload problem

I’ve got a page that does some fun stuff with data collection and outputs to a pdf. The data is stored in our database and is retrieved as json.

This works as expected for 99% of the forms we’ve created but one user has a problem where the page just reloads continuously.

If I step through the code I can see everything working just fine even for my two problem forms. I have a ton of console.log() turned on and all output as expected. Except that the page reloads.
SEMrush

I’ve got a pause on event listener for “DOMWindow.beforeunload” set and it stops there, sometimes, but the callstack just shows a jquery handler that also kicks in.

Because it doesn’t happen for every dataset I load I’d expect the problem to be in the data but then I’d also expect the unload to be triggered by something it doesn’t like in the code and for that to show in the callstack.

Any hints on how to debug this?