@Allan747, MN79 and other users discussing this problem
I had posted earlier in this thread and since then had explored this problem further in my computer. I have always installed the most recent Windows 10 updates and can confirm that as of the present, the problem still persists and has not been solved
by Microsoft. Some users including MN79 suggested downloading certain (non-Microsoft) programs that enable showing the tree of sub-folders with their correct sizes and then renaming those files with filenames that have too many characters. I did not try that
out, but their suggestions led me to suspect that the excessive lengths of filenames (including file paths) could at least be one important source of the problem.
Based on my experimentation, it appears that Windows 10 cannot detect folder sizes correctly when the folder contains subfolders (and further and further subdivisions into subfolders) so that finally the filenames (inclusive of file paths) exceed a
certain number of characters. To illustrate, Windows might show the size of folder A correctly if A is a primary folder. But if I store A as a subfolder of B, in turn a subfolder of C, and then in turn a subfolder of primary folder D, then Windows 10 might
show wrong sizes of D and all the subfolders (since finally for A, the filenames inclusive of file paths would be too long). This also explains why the same folder might show the wrong size in my SSD Windows Drive C, but when copied into the Data Drive D it
might show the correct size. This is because in Drive D it is a primary folder, but in Drive C you are already several steps down the "path" by the time you reach the "Documents" or "Pictures" folder.
Of course, the lengths of filenames won't help either. It is beyond me why some pictures, etc. I downloaded have filenames of over 50 characters.
The real solution has to be worked out by Microsoft, but based on the above, there is at least some way to avoid (NOT solve) the problem. (1) Avoid excessively long names for files and folders/subfolders. (2) More importantly, avoid too big a "tree"
with numerous "branching" into more and more subdivisions into subfolders. I know this is a bit difficult to follow since most new computers nowadays have an SSD of 256GB or 512GB and some in addition a 1TB hard drive.