I've had a similar issue and the problem was the php version used by actions: 7 instead of 8. Also in my case the same command runned by same user worked perfectly.
Solution was to use the correct php with full path: /opt/plesk/php/8.0/bin/php
By the way I recommend to run actions using file...