Hi,
I don’t know if it can help but I unchecked the first option in Enhanced Ecommerce Google Analytics (Add Global Site Tracking Code ‘gtag.js’ (Optional)) and saved. Then I checked it and saved again and the error disappeared.
I don’t know why it solved my problem but I have no more issues anymore.