How can i fix this error on JS : "Unable to find opt-out content div: “matomo-opt-out""

Hi here,
I’m trying to integrate an HTML code that serves as a cookie deactivation/activation message on my site.
This code (cf image1) is automatically generated by Matomo. Integrating it into my website is not a problem, it interacts correctly with the rest of my page, until I refresh it or change page. An error message that I’d never seen on Weweb appeared at the top of the page, either on the editor or on the production site, telling me: "Unable to find opt-out content div: “matomo-opt-out” ". (cf image2)
This may mean that the Matomo script runs before the div is actually available in the DOM.
I tried to rename the parent div in my HTML code in the same way, but it didn’t work.
I wanted to know if anyone has had this happen before?
I’ve tried integrating custom code into my page and triggering it from an on page load workflow in JS but I think I’m woefully inexperienced in this area… if someone can help me ?
Thanks in advance


does it work if you put the html elementin a separate sectiom and disable the setting to “hydrate section”?