Another thing I would like you to try. You said that when those images are removed from the list, and when they come back, tags are missing.

So, can you please try this: pick one of the images that will be removed. Add a tag, save a tag to that image. Then go to Downloads folder with file manager app and copy that image somewhere. If you know how to check whether image has tags in it, please do so, otherwise send it to me. So, this image should have tags embedded in the XMP section.
After images are gone, and when they com back (and tags are lost), copy that same image somewhere and check if it has tags now. Or send it to me.

If tags were properly written into images, even if image is removed from database and later added again, it should have all tags as they would be reread from the image. I am trying to find out whether there is some issue with writing tags or with images themselves, or something else…