Hello there,
According to my research, this error "drive could not be removed because not all data could be reallocated" usually occurred when the remaining drives do not have sufficient free space to support the removal of the member drive. We could try to backup part of the data in the storage space to a external media firstly. Ensure the remaining drive have sufficient free space to support the remaining data in the storage space. Then replace the drive and copy back the data.
I'm not sure you can remove a drive from a storage pool without the drive getting wiped and left as unallocated.
This issue may be due to any of the service that is still being used by the device. I would suggest you to turn off the RT Device completely and then try to disconnect and check if it helps. When you turn off the Device all the services will be turned off, and this will help you in this situation.
Similar discussion here https://social.technet.microsoft.com/Forums/en-US/01002ab6-08c0-475c-b28a-d34e0ce68fce/storage-spaces-detached-unable-to-remove-failed-drive-repair-pool?forum=win10itprohardware
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer–