I am not sure what you are doing to your phone for it to act like that
It happened to me when I was using shitty brands like Xiaomi that include a lot of malware and spyware in their official firmwares. Not anymore on grapheneOS (and /e/os on my daughter's phone).