Thanks for the answer.
I removed all modules and redid the installation by following this step by step.
https://design.briarmoon.ca/tutorials/drupal/setting-up-the-brotli-extension-for-php
Worked perfectly. I hope this topic resolves once and for all the doubts of anyone who had or will have this error.
I understand that after activating Brotli on W3, W3 will create the files and send them to CDN, am I right?
Also, you need to do some configuration in Performance >> CDN >> Advanced >> Custom file list?