Just stumbled on this while troubleshooting unrelated issue.
These assume that Whonix templates are named
whonix-ws. In fact, my Whonix templates have always had custom names. Isn’t it a bad idea to hardcode template names? Would be better to use existing Whonix identification system, ie