For Windows 10 & 11, this can be done using Windhawk's taskbar-thumbnail-reorder mod.
Windows can natively support rearrangement of taskbar active thumbnails of different groups, not individual windows of the same group. For that, You need this hack.
I need this because I usually have minimum of two chrome browser windows opened and I need them arranged according to my 3 monitors in the taskbars and sometimes, windows mysteriously (low memories?) rearranged them in the taskbar automatically.