Timestamps get stored in each photo file's metadata, and there's an inherent problem involving how different platforms interpret and display metadata. Windows prioritizes that data the way Microsoft prefers, Android the way Google prefers, and on top of all of that there's a really big issue in that any storage media using a FAT-based file system is simply not able to handle file metadata in a proper manner (microSD cards use either FAT32 or exFAT by default). The FAT file system goes back to the 90's, it's now obsolete and simply isn't able to support today's technology.
So there are OS issues, that only get amplified with the limitations with the FAT file system of a SD card.. An example being, the timestamp in the file's metadata will be something like 2022:10:05:16:35:36
or year:month:day:hour:minute:second (note that UTC is the standard for time zones)
If you have a few thousands of photos in your photo library, in a purely logical, numerical sort using that timestamp is simple. But we humans don't necessarily use logic. Here in America we prefer month, date, year and a 12-hour clock tied to time zones to view that same metadata, so doing that same kind of numerical sort involves some background conversion. Now add in how Microsoft and how Google interpret the timestamps in a file metadata, all diluted by FAT limitations. You're using two different operating systems and different ways to check your file dates.
In an ideal world, you would be able to use all your devices (computers, laptops, mobile devices, etc.) that are fully compatible with each other or are all using the same operating system, but here in the real world there are too many commercial interests, profit motives, and just plain tribalism in mindsets. That leaves us to cope with compromises and workarounds with all of our gadgetry.
I'll tentatively suggest you try the Simple Mobile Tools Gallery Pro app instead, it's a pay-for version but only a $1.29
https://play.google.com/store/apps/details?id=com.simplemobiletools.gallery.pro&hl=en_US&gl=US
The point being, it has a much, much bigger feature set than the Gallery app. Be sure to go into the app's Settings menu to set it up accordingly to customize it to your particular needs -- i.e. there's a lot of options as to how you want the set the date appearance. Year-Month-Day or Month-Day-Year or Month/Day/Year and more, and use the display Sort icon in the top menubar.