Automation can't find shell command

I have created a simple automation to back up the sqlite HA database through a shell script and verified it works from within Terminal. The script is:

sqlite3 ~/config/home-assistant_v2.db “.backup ‘/root/jose/db_backup/ha_db_backup.db’”

When I run it as an automation from Developer Tools->Services it throws an error:

stdout: “”
stderr: “/config/shell_scripts/ line 4: sqlite3: not found”
returncode: 127

The error persists even when I replace sqlite3 by its full path /usr/bin/sqlite3.

What am I missing? Why is the automation not finding the command?

Shell commands can be a little tricky, take a look at this guide to see if you took all the correct steps.