What you’re doing is equivalent to
nix-shell -p "grim slurp"
Which won’t work because nix-shell expects
nix-shell -p "grim" "slurp"
Which then becomes
{...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (grim) (slurp) ]; } ""
According to the manual
nix-shell --packages
interprets each command line arguments as attribute names inside the Nix packages collection.
The error message is because you are giving multiple package names as a single argument.
Not the author. But thank you, I didn’t know that.