The killing apps thing started with Oreo on P10 lite and worsened from Andoid 9.
Edit: 3rd party apps with background, screen off permissions.
I'm on P10 and Android 9. I don't have this issue.
Have you done with the "Battery Optimization" (do a search in settings) to tell the phone not to kill the app, and the Battery -> App Launch and set apps to "Manual" and enable the various options?