LXD VMs not getting IPv4 attached properly

Sometime while trying to attach IP v4 to a LXD VMs either it attaches a different value or no value at all. I used command say lxc config device set VMNAME eth0 ipv4.address but assigned IP was something else like or blank at all.
Before setting this IP I stop the VM, attach network with command lxc network attach lxdbr0 VMNAME eth0 eth0 and then finally after attaching IP re-started the VM.
But somehow if I try lxc config device get VMNAME eth0 ipv4.address it shows correct value
whereas lxc list shows the wrong value.