Thanks for the help and sorry for the belated reply.
I have a clue of what is happening.
I have two templates template-debian and template-kicksecure. If I create to disposable VMs of template-debian, I can attach the device from one to another. But if the VM where I create the test loopback device is of template-kicksecure, then /dev/xvdi will not show up after attaching the test loopback device.
I don’t think it’s a problem with Kicksecure. I’ve probably installed or uninstalled something that I shouldn’t have. Maybe there’s some Qubes-specific package I’m missing.
You can try to recreate a new clean kicksecure template by following the official guide without your custom modifications and check block device attachment there.