I have not gone through all of this carefully, but in case it helps, recently I experienced something similar and was able to get around it.
Much of the media in one of my tables was suddenly coming up as having zero bytes. I realized upon closer inspection that it had to do with me updating the media column with a “lazy media object” type. Such objects appear to have some kind of temporary existence. Once I explicitly converted the media to a BlobMedia object before updating, everything updated fine.
I’m not sure if this information is relevant in your case