Plasma 6 bug, or bad command format

I have a simple bash command that runs fine from the command line. But fails when added in .profile during login. Essentially, here is the command:

printf ‘%s\n’ $(kwalletcli -q -f cryptsetup -e cryptpartition) | sudo --non-interactive cryptsetup open --type luks2 --batch-mode /dev/disk/by-label/cryptluks mycrypt

It seems that when run in .profile, the results of the printf don’t get piped correctly to the cryptsetup command, but works fine from the command line after logging in. I also tried creating a bash script and calling the script from .profile, and I get the same results. I also tried various combinations of echo, echo -n, and printf “%s”. None worked in .profile, with various errors.

Also, reporting 6.0 RC1 bugs at seems nonspecific to 6.0; there’s no 6.0 option in the pulldown for the KDE version. Am I missing something?

UPDATE, the script works as an autostart script, so functionally all is good now. I do wonder why the command won’t run in .profile.