pkill matches patterns, and that is the problem: pkill node also hits every process with node somewhere in its name. The -x flag makes it precise.
pgrep -a -x node
pkill -x node
With -x the pattern has to match the process name exactly. Add -f and it has to match the whole command line, so pkill -x -f 'python3 app.py' only matches when the entire command line is exactly that.
Run pgrep -a with the same options first. It lists what would match, with the command line, and nothing is killed. That is the safe order: look, then shoot.
By default pkill sends SIGTERM, which asks a program to stop politely. Only reach for -9 when that does not work, because SIGKILL gives the program no chance to clean up.
The caveat is the name length. Without -f, the name is the 15 characters from /proc/pid/stat, so a longer program name can fail to match with -x. In that case use -f with the full command line. Also remember that pkill can only signal processes you are allowed to signal, so your own, unless you run it as root.
Further reading: pkill(1) manual, procps, pgrep(1) manual