Google Search Console Error

Hi everyone, I'm having trouble connecting my WordPress website's Google Search Console to Google Tag Manager. When I try to connect, I get an error message that says 'The Google Tag Manager snippet on your site is in the wrong location on the page.' I've checked and the snippet is correctly placed within the <head> section of my website's code. I've also tried disabling other plugins and checking for conflicts with other scripts, but the issue persists. My website is created using OxygenBuilder on a VPS server. I used LSCache to improve the website performance. I don't know if it is causing by LS Cache or not, any advice on how to resolve this issue would be greatly appreciated.