Opening photos from the "files"-interface and clicking "next" will follow "sort by name" order, even when "sort by modified" is activated

It looks like this happens in two seperate Nextcloud instances (my own Nextcloud server, and on the Nextcloud environment I don’t administer (from an organization I work for)). My nextcloud instance runs as a snap. I don’t know about the other instance. Do more people recognize this maybe?

Btw: if you go to the “photos” app (environment), click on a photo and then click “next”, you do go to the next photo on the basis of “sort by modified”.