Some kind of interaction with the window usually (again can be app specific) … reverses the order to the window where this sequence started, then may or may not continue the original order.
I’ve seen this most consistently in apps where I commonly have too many windows open, VSCode iTerm and Chrome being the worst offenders. Edit: my worst offenders, the apps don’t do anything unusual here.