meta_display_get_tab_list() returns inconsistently ordered list when dialogs are open
If a window has opened a dialog (-window) above the main content, the window will always be the last item in the order returned by meta_display_get_tab_list() if the function is called with the workspace argument.
You can reproduce this by setting org.gnome.shell.app-switcher current-workspace-only to true and opening multiple Firefox windows. Now open more than one tab and try closing the window. Firefox should ask whether you want to close all tabs. Now use alt + key above tab to cycle between Firefox windows, the window with the dialog will always be the last one in the list.
Update: This particular bug also happens because of the filtering rules applied to the result, read #143 (comment 117139) for the more specific issue.