The situation is much worse than you think.
In fact, your forms don’t load at all whenever GTM loads before the forms library (which will randomly happen depending on network conditions).
This is because you have some — I must say — atrociously buggy custom JS being injected via GTM:
<script>
window.dataLayer = window.dataLayer || [];
var origin_open = XMLHttpRequest.prototype.open
, origin_send = XMLHttpRequest.prototype.send
, form_data = "";
XMLHttpRequest.prototype.send = function(a) {
form_data = Object.fromEntries(a);
origin_send.apply(this, arguments)
}
;
XMLHttpRequest.prototype.open = function(a, b) {
b.includes("admin-ajax.php") && (this.addEventListener("loadend", function(c) {
var d = ["form_id", "form_fields"];
if (JSON.parse(c.currentTarget.response).success) {
for (key in form_data)
d.some(function(e) {
return key.startsWith(e)
}) || delete form_data[key],
form_data[key] || delete form_data[key];
dataLayer.push({
event: "generate_lead",
form_data: form_data
})
}
}),
origin_open.apply(this, arguments))
};
</script>
Remove that JS immediately. It has a giant bug in assuming an XHR payload will be an iterable. How would that ever work with a GET?
Yes, sometimes you need to override XMLHttpRequest.prototype for instrumentation & analytics, but you simply cannot embark on this without experience.