Python 2 is not installed by default on RPiOS Bullseye.
I tried the same command line installation (in ~/.node-red) on one of my Pies and got the same syntax error. because there are python2 specific print statements instead of print()
But installing Dashboard via the editor hamburger menu | Manage Palette works fine.
So it looks like Manage Palette is the best way to install new nodes on Debian Bullseye.