If I remember correctly, Steve had a bug in his code that would falsely identify some directories as files or vice-versa. Maybe that's why you have a difference in number of files found between his code and CMD.
That wasn't so much a bug as just cleaning up the code with newer QB64 commands. When I first worked up the routine, we didn't have a _DIREXISTS and _FILEEXISTS, so we passed flags from the POSIX commands back to sort which was which. They work, but are redundant and folks kept mixing up which flag was which. (It's not a 0 or -1 flag, but instead a 1 or 2 value, so checking IF flag THEN... is always going to fail.) Swapping to _DIREXISTS and _FILEEXISTS cleaned out those constants and keeps things simple for people who wanted to tweak the routine for personal needs.
If I had to guess at the file count difference, I'd guess they're in a hidden directory (like the Recycle Bin) which dir is going to skip unless you set the /ah flags with it. The POSIX routines will list those files without regards of the flags.