I wrote privileged helper tool, which is is used by my application - it's working on all macOS versions, including Silicon platform (Big Sur, Monterey). Unfortunately, in some (very) rare cases users reported that helper tool is suddenly missing and it can't be (re)installed again by application. It's pretty random, it could happen even after few months of app usage. The purpose of my helper tool is to execute bash scripts, which contain file copy operations etc.
After additional troubleshooting, i've found out, that helper tool somehow gets disabled without any obvious reason (i can see the message about it, when trying to start it manually with launchctl). Luckily, adding -wF option to launchctl start command enables and starts it succesfully. After that, helper tool is running normally again and it's automatically started/stopped by macOS with boot/shutdown.
I would really like to find out, what is the reason for this misbehaviour? I can't replicate it on any of my systems so i am just speculating...
Any ideas or suggestions are welcome. Thx!