I'm having the exact same problem. Some files (not just folders, but mostly folders) seem to be randomly assigned incrorrect file types in the Finder, but otherwise working just fine when I open them.
They also report incorrect file sizes, ie. the normal and "on disk" sizes are completely mismatched, moreso than what you would usually see. Like a tiny file reported as 130MB or something.
Also, files I'm 100% certain I haven't modified have their file dates updated to a later time. I compared with backups and the contents still match though (proven 100% identical via checksums).
And most worryingly, those arepersistent across reboots, not just temporary hickups.
And it's happening to both my internal volume and an external one.
From what I can tell it seems that macOS is randomly mixing up the APFS metadata of individual files, but if it's a OS problem then why would it not affect more people? Searching online this is the only instance of somebody else talking about it that I could find.
I guess malware is a very real possibility, but I don't know how I would check for that?
I'm seriously starting to freak out about it...