I wasn’t able to access a dictionary value in an Ansible Jinja2 template until I realized that I needed to use Python method get on the dictionary variable.
I am still not sure if varname[item]['keyname'] should have worked instead of varname[item].get('keyname', '').
However I now have new abilities in my playbooks. 😎