It takes a few days, but it will sync up. Remove the device from scope if necessary, after a few cycles Apple will assume the device no longer has the applications and will allow you to reassign the licenses. If the device popups up later with the apps, Apple will remove them if they are no longer in scope.
Best practice is to unscope the device before wiping, but that is not always possible.
It is 6 days for the license to drop, after you remove the device from scope.
I had a reorganisation in my ASM and added multiple MDM servers, where we had one before. I was informed by Apple that I had 6 days to set up the MDM's and import the licenses, then re set up all of the policies to push back out to the devices. If I failed to do so the devices would remove the Apps, because that is the grace period for licenses.
If you leave the device in scope then it will keep the license, so you have to remove the device from the scope and wait the 6 days to recover the license.
MDM sometimes unscopes apps after wiping devices.
We have seen the same, Within a week time you get your license back.