I have a form that uses ajax submit "method", the ajax submit handler returns ajax response with complete form(the form has ajax wrapper outside of itself so no issue there) and it is not working for anonymous users. I am using dynamic_page_cache only at this point.
I am displaying this form via field formatter that I have on an entity(imagine comment form) and I am using lazy builder.
The thing is that the form works for anonymous users if there are multiple forms like this on a single page(imagine taxonomy term page listing entities) but it is not working when there is only one form(entity page..imagine node/1). By not working I mean the form will submit but not with ajax but traditionally via normal post method.
I have checked the form structure, wrapper, drupalSettings.ajax entries, JS errors, watchdog..everything, but I just cannot figure out why the form does not utilize ajax but will submit as normal form instead. I have compared loaded JS with anonymous and logged in user, nothing significant there. The only thing that I have found that differs is missing form_token input in the form compared to logged-in user but I have checked the FormBuilder and this is on purpose + when I'm listing multiple entities with this form the ajax works just fine without it.
And so since there are no errors anywhere I have nothing to grab on to for debugging.
So my question is how could/should I try to debug this issue?
This question is a follow-up from Does caching has to be manually disabled for ajaxified forms?