`salt`: Configuring custom templates - `qvm.prefs` misbehaving

My salted setup includes provisioning of custom templates that derive from the repository-supplied ones.
The corresponding *.sls looks like so:

{% set templates = {
  'archlinux-aur': {
    'source':           'archlinux',
    'label':            'red',
    'root_volume_size': '20GiB',
    'Comment':          'Archlinux template WITH AUR capabilities'},
  'debian-12-teamviewer': {
    'source':  'debian-12',
    'label':   'red',
    'Comment': 'Template for disposable teamviewer infrastructure'},
  'fedora-38-dev': {
    'source':           'fedora-38',
    'root_volume_size': '20GiB',
    'Comment':          'Development dedicated template'},
  'fedora-38-cups': {
    'source':           'fedora-38',
    'label':            'red',
    'root_volume_size': '12GiB',
    'netvm':            'sys-firewall',
    'icon':             'templatevm-red',
    'Comment':          'Template dedicated to printing/scanning'}}
%}
{% set default_root_volume_size = '10GiB' %}

# Assure prior run of *.sls guaranteeing package presence
include:
  - custom_dom0.dom0_assert_template_pkgs_presence

{% for tpl in templates %}
clone the template {{ tpl }}:
  qvm.clone:
    - require:
      - sls: custom_dom0.dom0_assert_template_pkgs_presence
    - name:   {{ tpl }}
    - source: {{ templates[tpl]['source'] }}
    - label:  {{ templates[tpl]['label']|default('--default') }}
configure the root volume size of {{ tpl }}:
  cmd.run:
    - name: 'qvm-volume extend {{ tpl }}:root {{ templates[tpl]['root_volume_size']|default(default_root_volume_size) }}'
set qubes preferences for {{ tpl }}:
  qvm.prefs:
    - name:  {{ tpl }}
    - netvm: {{ templates[tpl]['netvm']|default('--default') }}
    - icon:  {{ templates[tpl]['icon']|default('--default') }}
{% endfor %}

This appears to work just fine BUT for the call to the qvm.prefs state, which for each iteration of the for loop produces an error along the lines of

qubesadmin.exc.QubesValueError: VM name contains illegal characters

which is peculiar, as calls to the states qvm.clone & cmd.run in the same loop make also use of the {{ tpl }} construct likely to blame here …

Did I find a bug?