DeletedUser134
If code is stored in a profile, it can only be accessed and executed when that profile is active.
A User Profile is an isolated existence with essentially zero ability to affect the phone at a deeper level.
For the device, as opposed to a profile, to be compromised the exploit needs to either be in the Owner Profile or the firmware.
Direct Boot uses Device Encrypted Storage, but even if a User Profile can store data there (and I'm not sure whether they can or not), the Owner Profile, OS, or Firmware would have to be compromised to execute whatever is stored in the device encrypted storage.
Incidentally, if you want basically any kind of spyware to function on a GOS device it basically needs to be purpose designed to target GOS and/or be installed in the Owner Profile.