This might not be the answer you might be looking for, however I had similar issues, and after some trial and error my Gtag started to work when I disabled partytown in the config.yaml
:
analytics:
vendors:
googleAnalytics:
id: "G-XXXXXXXXXX"
partytown: false