Why does my Systemd command fail but I can execute it manually?

I can run the following command from my shell without issue

sudo -u ktrl /home/andrew/.cargo/bin/ktrl -d /dev/input/event3

However, when I try to make a service:

/etc/systemd/system/ktrl.service

[Unit]
Description=ktrl

[Service]
User=ktrl
Environment=HOME=/opt/ktrl
ExecStart=/home/andrew/.cargo/bin/ktrl -d /dev/input/event3
  
[Install]
WantedBy=multi-user.target

I get the following error from systemctl status ktrl.service

     Loaded: loaded (/etc/systemd/system/ktrl.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sat 2020-06-27 10:35:08 EDT; 5s ago
    Process: 23335 ExecStart=/home/andrew/.cargo/bin/ktrl -d /dev/input/event3 (code=exited, status=203/EXEC)
   Main PID: 23335 (code=exited, status=203/EXEC)
        CPU: 5ms

Jun 27 10:35:08 localhost.localdomain systemd[1]: Started ktrl.
Jun 27 10:35:08 localhost.localdomain systemd[23335]: ktrl.service: Failed to execute command: Permission denied
Jun 27 10:35:08 localhost.localdomain systemd[23335]: ktrl.service: Failed at step EXEC spawning /home/andrew/.cargo/bin/ktrl: Permission denied
Jun 27 10:35:08 localhost.localdomain systemd[1]: ktrl.service: Main process exited, code=exited, status=203/EXEC
Jun 27 10:35:08 localhost.localdomain systemd[1]: ktrl.service: Failed with result 'exit-code'.

I’m executing the command sudo -u ktrl /home/andrew/.cargo/bin/ktrl -d /dev/input/event3 as andrew. However, even if I switch to ktrl sudo su ktrl and run the command /home/andrew/.cargo/bin/ktrl -d /dev/input/event3 it still works

Go to Source
Author: user1991252