Android wildly misreporting file sizes

I once had a crappy old LG phone with 8 GB of storage (around 4 GB usable) that misreported my DCIM filder to be several gigabytes when that was an impossible size for it. I could copy it to the Micro SD card and it would report the size accurately. I could rename the file to DCIM2 or whatever and it would report the size accurately. But if I changed the name back again it would once more show the inaccurate size. (The overall amount of used and free space on the phone would be reported accurately.)

Now I have a much better Motorola phone (G6 running Android 9) and it has a similar bug. It has 32 GB of storage (around 24 GB usable) and it has a pair of thumbnail files that keep growing and growing, except that they aren’t. My 32 GB phone has around 9 GB free–and contains these two thumbnail files that total 48 GB at the moment. I rename them and they still show the same impossible size (both from the phone and from a connected PC.) I try to copy them and it gives every indication that it is really copying 24 GB files. (I never let it finish that bullcrap.) Deleting them causes little if any change to the amount of free space reported, and when the (camera?) app rebuilds them, they are still thee same impossible size.

This state of affairs isn’t doing any actual noticable harm to the use of the phone, but I am curious why it happens, and if it can be fixed.