'Pin to top'-files bad sort with expanded folder

I've found something funny with Label Defintions/Assignments, where sometimes files are erroneously sorted before folders when folders are expanded.

Instead of me trying to explain, here's how to reproduce:

  • Sort on filename, low to high.
  • In Folder Format/Sorting, select Mixing: "Folder listed before files".
    SortBug - Folder sorting
  • Create a file filter that moves some files to top:
    • In Prefs/Label Definitions, create a label that has 'pin to top' checked.
      SortBug - Label definition
    • In Prefs/Label Assignments, create a Wildcard Label with "_*" as filename, and have it use the label we just created.
      SortBug - Label assignment
  • Create new 'root' folder.
  • In root folder, create 2 'pin to top'-files and 1 normal file.
  • In root folder, create 3 folders with alphabetically sorting names: "A", "B", and "C".
  • In folder B (middle folder), create 3 'pin to top'-files and 1 normal file.
  • Folders A and C can stay empty.
  • Go to root folder and refresh the lister.
  • Expand folder B using key shortcut or arrow in lister

Expected outcome: Root folder's files show in lister on bottom, below folders A, B, and C, like so:
SortBug - Outcome - Expect

Actual outcome: Root folder's 2 'pin to top'-files move to top of lister.
SortBug - Outcome - Actual

Under Folder > Folder Format (or Folder Options if using toolbars from an older version), what's the Mixing setting set to when in the shown folder?

Clipboard Image (1)