Remove and create directory in a single task is failing

You need to use with_nested:
https://docs.ansible.com/ansible/2.4/playbooks_loops.html#nested-loops