Every program on a Linux box shares /tmp. That is how temp file races and leftovers from one service bothering another happen.
One line gives a service its own private /tmp and /var/tmp:
sudo systemctl edit myapp.service
[Service]
PrivateTmp=yes
After a restart the service sees an empty /tmp that nobody else can see into, and its files there are not visible from your shell. Look inside the service’s mount namespace with nsenter -t PID -m ls /tmp and you get an empty list, while the normal /tmp has other files.
The private folders are removed when the service stops, so leftover temp files clean themselves up.
To find those files while it runs, look under /tmp/systemd-private-*-myapp.service-*/ as root. That is where systemd keeps the real directory.
This breaks things that share files through /tmp on purpose. A Unix socket in /tmp that another program connects to, or a script that hands a file to a service by writing it to /tmp, will stop working. I’d move those to RuntimeDirectory= or another agreed path first. Units that use DynamicUser=yes get this setting automatically.
Further reading: systemd.exec man page