The proxmox create task can return before pmxcfs has flushed the .conf, so the first delegated lineinfile hit 'Destination /etc/pve/lxc/<vmid>.conf does not exist'. Poll for the file with wait_for (up to 30s) before applying idmaps/GPU config, which continues as soon as it appears rather than eating a fixed sleep.