Dear Simone,
I also stumbled upon this issue. I finally figured out that the m5stack Unit Flashlight module has two operation modes.
It defaults to FLASH which is controlled by some custom logic which can be found here:
https://github.com/m5stack/M5Unit-FlashLight/blob/main/SetFlashTimeAndBrightness/SetFlashTimeAndBrightness.ino
But you can open the device and switch it to TORCH mode using a physical switch inside. Then you can use PWM to control it.
The details regarding the operation modes and PWM can be found in the specs starting at page 12:
https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/FlashLight/FLASHLEDDRIVER_2019-07-01.PDF
This will hopefully help others stumbling upon this.
Best regards