Hi everyone,
Try this:
Settings
Device Maintenance
Battery
Scroll down to "Whitout Supervision"
Add Application
Select the app with problems
Done
The names above could vary because I've them in another language. The idea is to tell the the software to not "optimize" those specific apps.