Thank you for the feedback. I have a xiaomi poco m5s and it worked with Macrodroid: the flash worked when the phone had the screen off and locked. and indeed: the batch stops when the phone is turned off. there is no log when it is turned off and therefore the phone is locked. and I confirm that the energy saving for "Automate" is indeed deactivated.
Especially since my other batch concerning sending emails when I enter or leave a geographical area works when the phone screen is off. therefore “Automate” continues to operate in the background.